Centos6的yum源无法更新

原因分析:

2020年12月2日下架了包括官方所有的CentOS6源(包括国内的镜像站)CentOS 6的yum 官网不在维护,所以镜像的yum源也不在维护了,尝试使用网上搜的替换阿里云、163的yum源,发现也不行了。

解决方案:

使用centos-vault作为更新源

具体操作:

1.更换yum源
先执行

vi /etc/yum.repos.d/CentOS-Base.repo

再将CentOS-Base.repo中的内容全部用下面代码替换,注意替换对应的centos的版本号
name=CentOS-6.10
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/

# 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.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

2.更换epel源

先执行 ,进入epel.repo文件

vi /etc/yum.repos.d/epel.repo

将源epel.repo文件中所有内容用下面代码替换

[epel]
name=epel
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-$releasever&arch=$basearch
enabled=1
gpgcheck=0

按下ESC,输入 :wq 保存并退出文件

3.清除缓存

yum clean all && yum makecache

参考文章:
epel源mysql版本_CentOS使用EPEL源的方法步骤

Centos6系统yum无法使用-最新解决办法

心得体会:

感谢上面两篇文章的作者,帮助我这个linux小白解决问题。目前是看网课在学习大数据部分知识,因为网课的录制实在centos6停止维护前录制的,所以视频中老师的操作现在并不能完全照抄,导致这个问题困扰了我好久,现在终于解决了,芜湖!第一次写博客以此记录此次解决过程。希望看到这篇文章的朋友能对你有所帮助。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值