由于我是用的系统是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=
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=
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=
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=
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=
enabled=
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=
enabled=
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进行安装、卸载软件

Centos5.11 使用yum源的更多相关文章

  1. centos6.4搭建基于ftp的yum源让本地局域网服务器使用

    1. 挂载centos6.4 DVD镜像[root@centos64 ~]# mount /dev/cdrom /mnt 2. 安装vsftp软件,启动vsftpd服务,拷贝centos6.4 DVD ...

  2. 阿里云centos5升级yum源为6

    升级后出现Errno -3] Error performing checksum 需要安装 python-hashlib Python 2.4 安装 hashlib 2012年11月13日 14:29 ...

  3. CentOS-5的yum源无法使用问题

    CentOS-5的yum源无法使用问题 [root@37wan ~]# yum -y install gcc Loaded plugins: fastestmirror Determining fas ...

  4. CentOS修改各大yum源(centos5,centos6,centos7)

    备份原配置文件 进入yum源配置目录: cd /etc/yum.repos.d 如果没有先安装wget: sudo yum install wget 修改yum源,就是修改CentOS-Base.re ...

  5. 建立自己的Yum源

    转自http://kicklinux.com/setup-yum-repos-server/ 命令 reposync 可以直接同步yum源 如/etc/yum.repos.d/cloudera-cdh ...

  6. CentOS下建立本地YUM源并自动更新

    1. 尽管有很多的免费镜像提供yum源服务,但是还是有必要建立自己的yum服务器,主要出于以下几点考虑: l 网络速度:访问互联网可能比较慢 l 节省带宽:如果有大量的服务器,架设自己的yum源可以有 ...

  7. redhat7 配置使用centos的yum源

    新安装了redhat7.安装后,登录系统,使用yum update 更新系统.提示: This system is not registered to Red Hat Subscription Man ...

  8. 利用阿里云提供的镜像快速更换本地的yum源

    打开网页:http://mirrors.aliyun.com/ 从“ 文件列表 ”找到自己的系统: Mirror Last update Help CPAN 2015-07-15 15:36:50   ...

  9. 配置yum源方法,以及失效时的处理

    正常方法如下: step1: 备份原CentOS-Base.repo 文件 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-B ...

随机推荐

  1. 5.JavaScript改变样式,验证用户输入

    ① x=document.getElementById("demo") //找到元素 x.style.color="#ff0000"; //改变样式 ② if ...

  2. Shell之历史操作记录与欢迎信息

    history: ~/.bash_history:用于记录所有的操作记录 欢迎信息:/etc/issue,只对本地登录生效. 远程终端的欢迎信息:/etc/issue.net

  3. spring+mybatis项目整合

    前辈总结的很详细,贴出链接,参考学习 http://www.open-open.com/lib/view/open1392252233301.html

  4. UVA10561 Treblecross —— SG博弈

    题目链接:https://vjudge.net/problem/UVA-10561 题意: 两个人玩游戏,轮流操作:每次往里面添加一个X,第一个得到XXX的获胜. 题解: 详情请看<训练指南&g ...

  5. 通过Chrome浏览器进行android调试/Remote Debugging on Android with Chrome

    The way your web content behaves on mobile can be dramatically different from the desktop experience ...

  6. 【C】由printf("%d\t%d\t%d\n",a,a+=(a++),a);引起的思考

    #include<stdio.h> int main() { ,a1=; ,b1=; printf("(1)后自加:\n"); printf("a+=(a++ ...

  7. linux命令学习笔记 : install 命令

    install .作用 install命令的作用是安装或升级软件或备份数据,它的使用权限是所有用户. .格式 ()install [选项]... 来源 目的地 ()install [选项]... 来源 ...

  8. CPU、内存、硬盘分区的检测.py

    cpu_mem_directories.py   CPU.内存.硬盘分区的检测 #!/usr/bin/env python #coding:utf-8 import psutil import tim ...

  9. 【217】◀▶ IDL 控制语句说明

    参考:Statements Routines —— 控制语句关键字 01   FOR 循环语句. 02   FOREACH 循环语句. 03   WHILE...DO 循环语句. 04   IF... ...

  10. Flutter实战视频-移动电商-64.会员中心_顶部头像UI布局

    64.会员中心_顶部头像UI布局 会员中心的样式 member.dart 清除原来的代码生成一个基本的结构 默认返回一个scaffold脚手架工具,body里面布局使用ListView,这样不会出现纵 ...