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

[root@37wan ~]# yum -y install gcc
Loaded plugins: fastestmirror
Determining fastest mirrors
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

可以看出:URLs不是ftp或http地址,打开yum查看:

[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/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[root@ yum.repos.d]# wget mirrorlist=http://mirrorlist.centos.org/6release=$releasever&arch=$basearch&repo=os
[1] 4853
[2] 4854
[root@ yum.repos.d]# mirrorlist=http://mirrorlist.centos.org/6release=: Unsupported scheme.

即源的网址有问题。
更新文件内容,用以下内容替换:

# 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源缓存:
yum clean all #清空yum源缓存
yum makecache #从新加载新缓存

用国内的yum源会出现一下问题,用上述解决办法,也ok,虽然会有一个连接报错

http://mirrors.aliyun.com/centos/5/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found

用浏览器打开http://mirrors.aliyun.com/centos/5/os/x86_64/repodata/repomd.xml,根本找不到这个文件,163……也是,但是Centos6内有,说明国内也不知Centos5了!

CentOS-5的yum源无法使用问题的更多相关文章

  1. centos 5的yum源无法使用的解决方法( 转载)

    由于centos 5 已经停更.于是导致yum源也不能用了. 例如安装screen的时候提示 Determining fastest mirrors* base: denver.gaminghost. ...

  2. CentOS 5 yum源无法使用

    在新装的CentOS 5.7系统中,由于CentOS 5.7版本比较旧,yum源无法使用. 尝试多种方法,最终从http://blog.csdn.net/zhuix7788/article/detai ...

  3. 常用的CentOS 7系统yum源集合

    常用的CentOS 7系统yum源集合   yum源对于linux系统的安装有非常大的帮助了,下面小编为各位整理了常用的CentOS 7系统yum源集合了,希望这篇文章能够对各位有所帮助的哦.   记 ...

  4. CentOS配置本地yum源(使用镜像iso文件)

    本人在使用yum安装软件的时候,感觉最不爽的是网络不佳时,安装的速度特别慢.所以,个人就上网search了一下如何使用Linux的安装文件作为其yum源.经过几次尝试,已经可以成功的配置了.下面是详细 ...

  5. CentOS下安装yum源的流程和操作

    一般公司都用Linux来搭建服务器,Linux安装软件时能够用yum安装依赖包是一件非常简单而幸福的事情,因为你只需一个简单的安装命令yum install []即可安装相应的软件,yum工具会自动的 ...

  6. RedHat Enterprise Linux 6.4使用Centos 6的yum源问题

    RedHat Enterprise Linux 6.4使用Centos 6的yum源问题 作为一名新手,学习Linux已经一个月了,其间遇到了不少问题,而今天笔者遇到的问题是 #yum install ...

  7. centOS下更新yum源

    CentOS下更新yum源 1.使用如下命令,备份/etc/yum.repos.d/CentOS-Base.repo. cp /etc/yum.repos.d/CentOS-Base.repo /et ...

  8. RHEL 6.6配置网易CentOS镜像的yum源小结

       之前没有使用过网易CentOS镜像的yum源,最近由于需要,遂在一台测试服务器验证.测试了一下如何配置使用网易的Cent0S的yum源.此文仅仅是笔记性质,参考了网上大量资料(文末"参 ...

  9. CentOS / RHEL 配置yum源

    CentOS / RHEL 配置yum源 */--> CentOS / RHEL 配置yum源 Table of Contents 1. 前言 2. 关于yum 2.1. yum是什么 2.2. ...

随机推荐

  1. 天马行空云计算(二)-Hardware&Hypervisor介绍

    天马行空云计算系列一介绍了总体抽象视图,本篇展开Hardware&Hypervisor 介绍.如下是介绍大纲: 本篇将基于上述架构从如下方面介绍说明 Linux设备驱动 因为上述提到的一些硬件 ...

  2. 高可用OpenStack(Queen版)集群-4.keystone集群

    参考文档: Install-guide:https://docs.openstack.org/install-guide/ OpenStack High Availability Guide:http ...

  3. slotting filter笔记

    1.slot filling是为了让用户的意图转化为明确的指令而补全信息的过程. 2.准入条件 从一个开放域转入到封闭域,或者从一个封闭域转入到另一个封闭域,中间的跳转是需要逻辑判断的,而这个逻辑判断 ...

  4. fetch err : "Body not allowed for GET or HEAD requests"

    在使用 fetch 的时候 报了  "Body not allowed for GET or HEAD requests" 这个错. 代码如下: 一番google , 找到答案了. ...

  5. so easy, too happy

    一.预估与实际 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning 计划 • Estimate • 估计这个任务需要多 ...

  6. HDU 4568 Hunter 最短路+TSP

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4568 Hunter Time Limit: 2000/1000 MS (Java/Others)Me ...

  7. 1003 我要通过!| PAT (Basic Level) Practice

    1003 我要通过! (20 分) "答案正确"是自动判题系统给出的最令人欢喜的回复.本题属于 PAT 的"答案正确"大派送 -- 只要读入的字符串满足下列条件 ...

  8. Alpha 冲刺报告2

    Alpha 冲刺报告 队名: 组长:吴晓晖 今天完成了哪些任务: 代码量300+,完成了百度地图API的引入. 展示GitHub当日代码/文档签入记录: 明日计划: 整理下这两个功能,然后补些bug ...

  9. HDU 2109 Fighting for HDU

    http://acm.hdu.edu.cn/showproblem.php?pid=2109 Problem Description 在上一回,我们让你猜测海东集团用地的形状,你猜对了吗?不管结果如何 ...

  10. node websocket学习研究

    websocket作为不同于http的数据传输方式,是开发一些实时系统的不二选择. 最近在研究开发websocket方面的小程序.小程序客户端直接对websocket做了封装.自己只要写后端就可以了. ...