更換Red Hat Enterprise Linux 7 64位的yum為centos的版本

來源:互聯網
上載者:User

標籤:rgs   release   過程   lin   相互   host   parser   localhost   linu   

  • 查看redhat原有的yum包有哪些:
[[email protected] ~]# rpm -qa|grep yumyum-utils-1.1.31-24.el7.noarchyum-langpacks-0.4.2-3.el7.noarchyum-metadata-parser-1.1.4-10.el7.x86_64yum-rhn-plugin-2.0.1-4.el7.noarchPackageKit-yum-0.8.9-11.el7.x86_64yum-3.4.3-118.el7.noarch
  • 嘗試使用xargs來刪除這些包
[[email protected] ~]# rpm -qa|grep yum|xargs rmp -e --nodepsxargs: rmp: 沒有那個檔案或目錄
  • 沒有xargs 一個一個刪除
[[email protected] ~]# rpm -qa|grep xargs[[email protected] ~]# rpm -e --nodeps yum-utils-1.1.31-24.el7.noarch[[email protected] ~]# rpm -e --nodeps yum-langpacks-0.4.2-3.el7.noarch[[email protected] ~]# rpm -e --nodeps yum-metadata-parser-1.1.4-10.el7.x86_64[[email protected] ~]# rpm -e --nodeps yum-rhn-plugin-2.0.1-4.el7.noarch[[email protected] ~]# rpm -e --nodeps PackageKit-yum-0.8.9-11.el7.x86_64[[email protected] ~]# rpm -e --nodeps  rpm -e --nodeps yum-3.4.3-118.el7.noarch[[email protected] ~]# rpm -qa|grep yum
  • 查看當前作業系統版本
[[email protected] ~]# cd /etc[[email protected] etc]# cat redhat-release Red Hat Enterprise Linux Server release 7.0 (Maipo) 
  • 下載centos的yum
[[email protected] ~]#wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm [[email protected] ~]#wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm [[email protected] ~]#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 必須先刪除老的版本
[[email protected] ~]# rpm -e --nodeps  python-urlgrabber-3.10-4.el7.noarch[[email protected] ~]#wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm [[email protected] ~]#rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm [[email protected] ~]#rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm 
  • 最後兩個相互依賴 所以要放在一起執行
[[email protected] ~]#rpm -ivh  yum-3.4.3-150.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm  
  • 更換yum源
[[email protected] ~]#cd /etc/yum.repos.d/[[email protected] ~]#wget  http://mirrors.163.com/.help/CentOS7-Base-163.repo 注意:此處需要將CentOS7-Base-163.repo中的$releasever全部換成7
  • 重建緩衝
[[email protected] ~]#yum clean all[[email protected] ~]#yum makecache  按照網上的步驟的花,最後一步還有一個“yum update”,會把所有的rpm都更新到最新狀態,我暫時覺得沒有必要沒有執行。 最終測試yum install成功。

更換Red Hat Enterprise Linux 7 64位的yum為centos的版本

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.