将RHEL7.5的yum修改为centos的163源
程序员文章站
2022-11-06 22:29:06
RHEL的yum是要给钱才能用的,想要不给钱的用,就把原装yum替换为centos的yum1.查看原有yum包rpm -qa|grep yumyum-langpacks-0.4.2-7.el7.noarchyum-metadata-parser-1.1.4-10.el7.x86_64yum-rhn-... ......
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