1. 程式人生 > >Red Hat設置使用CentOS的yum源

Red Hat設置使用CentOS的yum源

install ogre 安裝軟件 yum python2.6 ipa 刪除 data python

  環境查看

技術分享圖片

  red hat系統使用自己默認的yum源未註冊在使用yum安裝軟件的時候會出現以下錯誤提示

技術分享圖片

  可以修改成centos的yum源

  卸載yum軟件

rpm -qa|grep yum|xargs rpm -e --nodeps(不檢查依賴,直接刪除rpm包)
rpm -qa |grep yum (查詢確認)

  下載軟件包

http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

  安裝python包

rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm 
rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm 

  安裝python-urlgrabber報錯

warning: python-urlgrabber-3.9.1-11.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
	file /usr/lib/python2.6/site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
	file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
	file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
	file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
	file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch

技術分享圖片

  原因:系統包含老版本

技術分享圖片

  卸載

rpm -e python-urlgrabber-3.9.1-9.el6.noarch

  再次安裝成功

技術分享圖片

  安裝yum-metadata

rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

  安裝yum

 rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm 

  PS:需要兩個包一起安裝否則報依賴錯誤

  

  更改yum源

  下載配置文件

http://mirrors.163.com/.help/CentOS6-Base-163.repo

  放置文件夾/etc/yum.repos.d

  替換內容(這裏的red hat版本為6所以替換為6)

sed -i "s#\$releasever#6#g" CentOS6-Base-163.repo

  備份原有文件使用新文件替換

mv rhel-source.repo rhel-source.repo.bak
mv CentOS6-Base-163.repo rhel-source.repo

  清理緩存

 yum clean all

  將服務器軟件包信息緩存至本地,提高搜索安裝效率

yum makecache

  測試安裝

技術分享圖片

  測試安裝

yum -y install lrzsz

  

Red Hat設置使用CentOS的yum源