在新装的CentOS 5.7系统中,由于CentOS 5.7版本比较旧,yum源无法使用。

尝试多种方法,最终从http://blog.csdn.net/zhuix7788/article/details/73369209得到了解决方法。

vi /etc/yum.repos.d/CentOS-Base.repo更新文件内容,内容替换。

#<span style="background-color: rgb(255, 102, 102);"><strong><span style="color:#ff6666;">
# 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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://vault.centos.org/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://vault.centos.org/5.11/extras/$basearch/
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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=http://vault.centos.org/5.11/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5</span></strong></span>

最后:yum clean all

最新文章

  1. 小小border用处多
  2. 做小图标还用sprite图?你out了!史上最简单易懂iconfont使用教程
  3. 酷酷的jQuery classicAccordion 手风琴
  4. Just a Hook(HDU1698 线段树的简单应用)
  5. ASP.NET内置对象详解
  6. 解决 “无法安装 Visual Studio 2010 Service Pack 1,因为此计算机的状态不支持”
  7. jQuery 的插件 dataTables
  8. 【NHibernate】HQL入门
  9. Java IntelliJ IDEA 不能显示项目里的文件结构解决办法
  10. 一些小bug
  11. 蓝桥网试题 java 算法训练 区间k大数查询
  12. app与后台交互之间的几种安全认证机制
  13. vijos1760题解
  14. DateTable转化为泛型集合
  15. Spring Boot Document Part II(上)
  16. n对n
  17. jedis &amp; common pool
  18. oracle 11g RAC 的基本操作(一)------启动与关闭
  19. windows通过node环境搭建安装npm,cnpm,vue-cli
  20. 第五周学习总结-HTML5

热门文章

  1. mongodb 数组查询
  2. 初识jmeter(2)
  3. 机器学习【工具】:Numpy基础
  4. linux配置IP访问权限
  5. schtasks 命令使用
  6. phpstudy + dvws
  7. sqlserver配置允许快照隔离
  8. Springmvc 使用 AbstractExcelView 导出excel
  9. 为什么mysql 5.7.24启停不显示错误信息?log-error_verbosity参数
  10. 【UNIX网络编程(三)】TCP客户/server程序演示样例