Red Hat怎麼更換Centos yum?,centosyum
查看redhat原有的yum包有哪些:
[root@localhost ~]# rpm -qa | grep yum[root@localhost ~]# rpm -e --nodeps yum相關rpm包
下載centos的yum:
[root@localhost ~]#curl -o yum-metadata-parser-1.1.4-10.el7.x86_64.rpm https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm[root@localhost ~]#curl -o yum-3.4.3-150.el7.centos.noarch.rpm https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm[root@localhost ~]#curl -o yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm wget https://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
安裝centos的yum 安裝過程中發現依賴了python-urlgrabber 又下載並安裝了它安裝python-urlgrabber 必須先刪除老的版本:
[root@localhost ~]#rpm -e --nodeps python-urlgrabber[root@localhost ~]#curl -o python-urlgrabber-3.10-8.el7.noarch.rpm https://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm[root@localhost ~]#rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm[root@localhost ~]#rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
最後兩個包相互依賴 所以要放在一起安裝:
[root@localhost ~]#rpm -ivh yum-3.4.3-150.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
更換yum源:
[root@localhost ~]#cd /etc/yum.repos.d/[root@localhost ~]#wget https://mirrors.163.com/.help/CentOS7-Base-163.repo注意:此處需要將CentOS7-Base-163.repo中的$releasever全部換成7
重建緩衝:
[root@localhost ~]#yum clean all[root@localhost ~]#yum makecache