Redhat7.0使用阿里源

借鉴:https://blog.csdn.net/hongbin_xu/article/details/79316614

仅供参考

流程:

1. 删除redhat系统自带的yum软件包;
2. 自行下载所需要的软件包;
3. 根据依赖项安装;
4. 新建repo配置文件。


卸载:rpm -qa | grep yum | xargs rpm -e --nodeps
下载安装包路径:https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/
安装:

rpm安装: rpm -ivh
rpm更新:rpm -Uvh
--nodeps 安装时不检查依赖关系;
--force 强制安装。
建议一个一个的安装方式:rpm -ivh ,不建议使用 rpm -ivh yum*

创建:xxx.repo 文件

内容比如:

#CentOS-ali.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$7 - Base - aliyun.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
baseurl=https://mirrors.aliyun.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$7 - Updates - aliyun.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
baseurl=https://mirrors.aliyun.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$7 - Extras - aliyun.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
baseurl=https://mirrors.aliyun.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$7 - Plus - aliyun.com
baseurl=https://mirrors.aliyun.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0

gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7


测试yum是否成功

安装树状图

yum -y install tree

清除yum缓存

yum clean all

yum makecahe


你可能感兴趣的:(red,linux,Linux)