centosxxx + redhat5.5 快速設置網絡源

centos設置網絡源html

http://mirrors.163.com/.help/centos.htmlnode

 



具體原理爲何緣由請看最下面的解釋。python


方法一:
vim

更換網絡源:centos

  1. 卸載自帶的rpm     rpm -qa |grep rpm網絡

rpm -qa|grep yum |xargs rpm -e --nodepside

  2. 安裝centos用的yum測試

 
wget   http://vault.centos.org/5.5/os/x86_64/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm
this


wget  http://vault.centos.org/5.5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
url

wget   http://vault.centos.org/5.5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm(無關緊要)

wget  http://vault.centos.org/5.5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm


   3.   下載163源

          wget http://mirrors.163.com/.help/CentOS5-Base-163.repo   (將原來的備份一下)

          vi  CentOS5-Base-163.repo      把其中的$releasever所有替換成5

          :s@$releasever@5@g     由於有$變量 此時用/報錯 因此用@


   4.  導入證書 先下載再導入

   wget    http://vault.centos.org/5.5/os/x86_64/RPM-GPG-KEY-CentOS-5

   rpm  --import     http://vault.centos.org/5.5/os/x86_64/RPM-GPG-KEY-CentOS-5 


   5.   yum  clean all

   6.  yum  makecache


方法二:

 Redhat Linux一般因爲沒有註冊,致使yum程序沒法使用,須要將其替換爲centos的yum程序。
1. 下載Yum的安裝包,因爲體系結構的不一樣和包的更新,所以目錄和文件名的版本號可能須要調整如下。
#wget  http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
#wget  http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
#wget  http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
2. 查出當前的yum程序,進行卸載
#rpm -qa|grep yum
# rpm -e yum-3.2.22-20.el5 --nodeps
# rpm -e yum-updatesd-0.9-2.el5 --nodeps
# rpm -e yum-security-1.1.16-13.el5 --nodeps
# rpm -e yum-metadata-parser-1.1.2-3.el5 --nodeps
# rpm -e yum-rhn-plugin-0.5.4-13.el5 --nodeps
3. 下載並導入KEY
# cd /etc/pki/rpm-gpg/
# wget  http://mirrors.sohu.com/centos/RPM-GPG-KEY-CentOS-5
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
4. 安裝yum安裝包
rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm \
 yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm \
 yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
5. 修改配置文件
mv /etc/yum.repos.d/rhel-debuginfo.repo  /etc/yum.repos.d/rhel-debuginfo.repo.bak
vi /etc/yum.repos.d/rhel-debuginfo.repo


[base]
name=Red Hat Enterprise Linux $releasever -Base
baseurl=http://mirrors.163.com/centos/5/os/$basearch/
gpgcheck=1
[update]
name=Red Hat Enterprise Linux $releasever -Updates
baseurl=http://mirrors.163.com/centos/5/updates/$basearch/
gpgcheck=1
[extras]
name=Red Hat Enterprise Linux $releasever -Extras
baseurl=http://mirrors.163.com/centos/5/extras/$basearch/
gpgcheck=1
[addons]
name=Red Hat Enterprise Linux $releasever -Addons
baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
gpgcheck=1


六、清理yum源
yum clean all 
七、yum install vim #測試一下可不能夠用


至此yum安裝完成,能夠 yum install 安裝程序了





註釋: 如今網絡上不少redhat5.5設置163網絡源 都失效了,是由於163源不提供redhat5版本的更新了,裏面只留了個文檔 ,不過裏面寫的很清楚 ,

This directory (and version of CentOS) is deprecated.  For normal users,
you should use /5/ and not /5.5/ in your path. Please see this FAQ
concerning the CentOS release scheme:

If you know what you are doing, and absolutely want to remain at the 5.5
level, go to http://vault.centos.org/ for packages. Please keep in mind that 5.5 no longer gets any updates

翻譯:

此目錄(和版本的CentOS的)已通過時了。對於普通用戶來講,
你應該使用/5/在你的路徑不/5.5/。請參閱此常見問題解答
關於CentOS的發行方案:

https://wiki.centos.org/FAQ/General

若是你知道你在作什麼,絕對要保持在5.5
的水平,去http://vault.centos.org/~~V包。請記住,5.5再也不得到任何更新

能夠去

  http://vault.centos.org/5.5/os/x86_64 尋找咱們須要的

相關文章
相關標籤/搜索