centos5系统更新 yum源

各大镜像站只有最新版本目录有内容,其他版本目录下仅有readme文件

下载的CentOS-Base.repo文件,放到/etc/yum.repos.d/下都用不了

在readme文件中发现http://vault.centos.org/网站是有各个版本镜像的

备份原来的文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

重新编辑yum源配置文件 写入如下内容 本文档以5.5版本为例 ,如是其他版本如5.8 ,可以利用txt记事本 查找替换 把5.5替换为对应的版本即可
%RAK部落%

vi /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-KaTeX parse error: Expected 'EOF', got '#' at position 127: …G-KEY-CentOS-5 #̲released update…releasever – Updates
baseurl=http://vault.centos.org/5.5/updates/i386/
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-KaTeX parse error: Expected 'EOF', got '#' at position 133: …G-KEY-CentOS-5 #̲additional pack…releasever – Extras
baseurl=http://vault.centos.org/5.5/extras/i386/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-KaTeX parse error: Expected 'EOF', got '#' at position 145: …G-KEY-CentOS-5 #̲contrib – packa…releasever – Contrib
baseurl=http://vault.centos.org/5.5/contrib/i386/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

保存文件后,运行yum clean all yum makecache

此教程来自固定链接:http://www.rakbuluo.com/p22/

猜你喜欢

转载自blog.csdn.net/xiayudaibas/article/details/92612445