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
测试一下发现熟悉的感觉又回来了。
浪费了两个小时终于搞好了!!!
标签:http,centos,CentOS,mirrors,centos6,yum,aliyun,无法,com 来源: https://blog.csdn.net/qq_39719415/article/details/120998021