本文已参与「新人创作礼」活动,一起开启掘金创作之路。
声明:本文乃“运维家”原创,转载请注明出处,更多内容请关注公众号“运维家”。
主旨
centos8于2021年底就停止维护了,那么我们的小伙伴可能已经发现无法通过yum下载软件了,这个怎么解决呢?别急,下面我们来看看。
环境
centos8
报错回忆
# 查看系统版本是 centos8
[root@jier ~]# cat /etc/redhat-release
CentOS Linux release 8.4.2105
[root@jier ~]#
[root@jier ~]# yum -y install httpd mariadb-server mariadb php php-mysql
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
CentOS-8 - AppStream 0.0 B/s | 0 B 00:08
Failed to download metadata for repo 'AppStream'
Error: Failed to download metadata for repo 'AppStream'
[root@jier ~]#
原因大家都知道,因为不维护centos8了,所以无法下载了,看下解决方案先。
解决方案
[root@jier ~]# cd /etc/yum.repos.d/
[root@jier yum.repos.d]# mkdir bf
[root@jier yum.repos.d]# mv *.repo bf/
[root@jier yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo
[root@jier yum.repos.d]# yum clean all && yum makecache
验证
这个简单了,我们重新下载我们需要的软件即可,在我这里验证是没有问题的。
至此,本文结束。