RedHat 網絡yum源的配置
阿新 • • 發佈:2018-02-23
oar 鏡像 備份 wget ever 3.2 yum源 卸載 ges 在安裝heartbeat的時候提示不能找到依賴的包,最後發現是yum源的問題。在網上查了很多資料,終於成功配置了yum網絡源,下面分享一下解決的辦法。
解決辦法:
1.卸載EHEL的yum,並下載CentOS的對應軟件包
[root@heartbeat-1-121 tools]# rpm -aq|grep yum yum-metadata-parser-1.1.2-16.el6.x86_64 yum-rhn-plugin-0.9.1-58.el6.noarch yum-3.2.29-69.el6.noarch [root@heartbeat-1-121 tools]# rpm -aq|grep yum|xargs rpm -e --nodeps [root@heartbeat-1-121 tools]# [root@heartbeat-1-121 tools]# rpm -aq|grep yum|xargs rpm -e --nodeps rpm: no packages given for erase
2.下載並安裝CentOS的對應的軟件包
(1)可以通過網站直接下載
http://mirrors.163.com/centos/6/os/x86_64/Packages/
(2)在線下載對應軟件包
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm [root@heartbeat-1-127 ~]# cd /home/linzhongniao/tools/ [root@heartbeat-1-127 tools]# ls yum-3.2.29-81.el6.centos.noarch.rpm python-iniparse-0.3.1-2.1.el6.noarch.rpm yum-metadata-parser-1.1.2-16.el6.x86_64.rpmpython-urlgrabber-3.9.1-11.el6.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
提示:如果不正確執行,網站沒有響應,意思這個包找不到了,以為版本更新了老版本刪除掉了,我們可以吧按原來的軟件名,在上面的那個網站裏找這些安裝包。
(3)安裝對應軟件包
[root@heartbeat-1-127 tools]# rpm -ivh *
每個人的而系統環境都不一樣,安裝過程中會遇到各種各樣的問題。缺失依賴的軟件包rpm安裝或者在鏡像源網站上下載安裝即可,如果提示軟件包沖突rpm –e卸載舊版本重新再鏡像源網站上下載安裝即可。
3.Yum網絡源配置
(1)先備份系統.repo文件
[root@heartbeat-1-127 ~]# cp /etc/yum.repos.d/rhel-source.repo /etc/yum.repos.d/rhel-source.repo.bak
(2)添加下面內容
[root@heartbeat-1-127 yum.repos.d]# cat rhel-source.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
gpgcheck=1
enabled=0
(3)清楚原來的源文件
`yum clean all`
(4)安裝yun源,測試新的yum 源有沒有安裝成功
yum install yum
(5)獲取yum列表
yum list
好,到此yum網絡源的配置成功了
RedHat 網絡yum源的配置