Red Hat怎麼更換Centos yum?,centosyum

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.