Centos 报错 Repository extras is listed more than once in the configuration

使用 yum update -y 报错 Repository extras is listed more than once in the configuration

2020 年 12 月 8 号,CentOS 官方宣布了停止维护 CentOS Linux 的计划,并推出了 CentOS Stream 项目,CentOS Linux 8 作为 RHEL 8 的复刻版本,生命周期缩短,于 2021 年 12 月 31 日停止更新并停止维护(EOL),更多的信息可以查看 CentOS 官方公告。如果需要更新 CentOS,需要将镜像从 mirror.centos.org 更改为 vault.centos.org

解决如下:

cd /etc/yum.repos.d/

#更新yum源为阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

#如果已经安装了wget就不需要这一步
yum install wget –y

yum clean all

yum makecache
#验证
yum install -y vim

``

猜你喜欢

转载自blog.csdn.net/qq_60361946/article/details/129174615