前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >centos6 yum 源失效问题解决办法,头疼的老机器

centos6 yum 源失效问题解决办法,头疼的老机器

作者头像
sinnoo
发布2022-01-04 16:24:46
8190
发布2022-01-04 16:24:46
举报
文章被收录于专栏:技术人生

一、centos6,git1.7.1

最近上手一个老项目,登录机器一看

centos6,vim编辑器没设置

安装配置一下vim吧

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

发现git还没发用,1.71版本

yum -y update

yum源也没法使用

这真是头疼,这么老的项目还拿出来维护干嘛,重构不得了!

二、从头开始

1.不用墨迹的了

阿里的yun源mirrors.cloud.aliyuncs.com/centos/6

清华的yum源 mirrors.tuna.tsinghua.edu.cn/centos/6

当然还有163,都无法使用了,里面只有一个readme文件,里面告诉你,centos的yum已经彻底不再维护

这不傻眼了呀

2.幸亏有个能用的

https://vault.centos.org/6.9/

进入yum源的配置文件夹:cd /etc/yum.repos.d/

把CentOS-* 全部删掉 (防止有问题可以备份下)

新建文件 CentOS-Base.repo

里面加入内容

代码语言:javascript
复制
[base]
name=CentOS-6
failovermethod=priority
baseurl=https://vault.centos.org/6.9/os/x86_64/
gpgcheck=0

然后执行

yum clean all yum makecache

3.如果makecache也报错timeout等相关问题

这里也可以更换另一个可用源

.repo文件内容,全部更新为如下:版本6.6可以更换为自己需要的

代码语言:javascript
复制
# 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-6.6 - Base
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/os/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[updates]
name=CentOS-6.6 - Updates
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[extras]
name=CentOS-6.6 - Extras
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/extras/x86_64/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[centosplus]
name=CentOS-6.6 - Plus
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
[contrib]
name=CentOS-6.6 - Contrib
baseurl=http://mirrors.aliyun.com/centos-vault/6.6/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021/01/19 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、centos6,git1.7.1
  • 二、从头开始
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档