centos6无法使用yum的问题解决

346 字
2 分钟
centos6无法使用yum的问题解决

2020年12月2日下架了包括官方所有的CentOS6源(包括国内的镜像站) centos6的下架使得centos6的yum无法直接再下载安装软件。 目前需要更新为下面两个源: #阿里云 http://mirrors.aliyun.com/centos-vault/

#官方 https://vault.centos.org/

#阿里云和官方的任选其一即可 具体操作如下: 第一步修改base源:

vi /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-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

第二步:

vi /etc/yum.repos.d/CentOS-fasttrack.repo
enabled=0

第三步:

rm /etc/yum.repos.d/docker-ce.repo(如果没有该文件可以忽略本步骤)

第四步:此处需要注意,粘贴的时候是否完整

vi /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
enabled=1
failovermethod=priority
#baseurl=http://mirrors.aliyuncs.com/epel-archive/6/$basearch
baseurl=http://mirrors.aliyun.com/epel-archive/6/$basearch
gpgcheck=0
gpgkey=http://mirrors.aliyuncs.com/epel-archive/RPM-GPG-KEY-EPEL-6

到这里就完成了,使用yum clean all && yum makecache更新一下yum缓存, 最后使用yum install httpd测试一下发现熟悉的感觉又回来了。

文章分享

如果这篇文章对你有帮助,欢迎分享给更多人!

centos6无法使用yum的问题解决
https://czxcly.cn/posts/centos6无法使用yum的问题解决/
作者
启源学社
发布于
2022-06-21
许可协议
CC BY-NC-SA 4.0

评论区

Profile Image of the Author
启源学社
公告
欢迎来到我的博客!
音乐
封面

音乐

暂未播放

0:00 0:00
暂无歌词
分类
标签
站点统计
文章
45
分类
2
标签
16
总字数
16,178
运行时长
0
最后活动
0 天前

文章目录