RHEL的yum是要给钱才能用的,想要不给钱的用,就把原装yum替换为centos的yum
1.查看原有yum包
rpm -qa|grep yum
yum-langpacks-0.4.2-7.el7.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-rhn-plugin-2.0.1-10.el7.noarch yum-3.4.3-158.el7.noarch PackageKit-yum-1.1.5-1.el7.x86_64 yum-utils-1.1.31-45.el7.noarch
2.卸载原yum包
rpm -qa|grep yum|xargs rpm -e --nodeps
3.创建下载路径,下载centos7.5 yum包
mkdir /tmp/pkg && cd /tmp/pkg
wget http://mirrors.163.com/centos/7.5.1804/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm wget http://mirrors.163.com/centos/7.5.1804/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7.5.1804/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
4.安装
rpm -ivh yum-*
5.替换原源
cd /etc/yum.repos.d/ && rm -rfv *
6.下载163源
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
7.将下载好的文件中的 $releasever 全部修改为目标版本 7.5.1804
8.重建缓存
yum clean all && yum makecache
yum repolist all