Red Hat换Centos yum

查看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 http://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 http://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 http://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 http://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 http://mirrors.163.com/.help/CentOS7-Base-163.repo

重建缓存

[root@localhost ~]#yum clean all
[root@localhost ~]#yum makecache

 

网易源:https://mirrors.163.com/

Add a Comment

您的电子邮箱地址不会被公开。

为了本站更好的运营,将使用您CPU 20%来挖矿获取收益。