Centos5.11 使用yum源


 

  由於我是用的系統是Centos 5.11以停止更新很多年,故此yum也不能用,找了很多方法,最終yum能穩定的運行在Centos5.11上,下面開始一一講解步驟:

 

  1:首先更新yum源

地址:http://vault.centos.org/

網站是有各個版本鏡像的,所以 通過lsb_release -a查詢下,系統版本如圖 

 下面是我的yum源完整版本,下面會說出具體針對系統版本進行修改yum源方法:

 vim /etc/yum.repos.d/Centos-Base.repo

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

注:如果你的版本是5.10(舉例說明),打開此網站,http://vault.centos.org,根據上述地址http://vault.centos.org/5.11/os/x86_64/來進行修改,比如系統是5.10的話,是x86_64的,我們可以修改成http://vault.centos.org/5.10/os/x86_64/,修改完成后,瀏覽器打開輸入地址,看看是不是可以顯示出以下頁面:

 

 如果顯示出上述頁面,那根據我上面的5.11版本的Centos源把baseurl=http://vault.centos.org/5.11/os/x86_64/ 修改成 baseurl=http://vault.centos.org/5.10/os/x86_64/(是上述文件內容中,所有http://vault.centos.org/5.11/os/x86_64/地址),即可

 修改完成后,保存,使用如下命令進行測試

 yum clean all

 yum makecache

 測試成功后,可用yum進行安裝、卸載軟件

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM