Centos8 stream 更新源

Centos8 stream 于2024年5月31号 停止了服务,大家再在使用yum源安装时候,出现下面错误“错误:

Failed to download metadata for repo ‘AppStream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist” 

1、进入yum的repos目录

cd /etc/yum.repos.d/

2、修改所有的CentOS文件内容

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-*

3、yum安装测试是否可以yum安装

yum install wget –y

4、更新yum源为阿里镜像

wget -O /etc/yum.repos.d/CentOS-Base.repo

https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

yum clean all

yum makecache

或者用以下Linux工具箱来更新 

(更新前请确保down.temvm.com 中的linux.sh文件是否存在)

curl -sSL down.temvm.com/linux.sh -o linux.sh && chmod +x linux.sh && ./linux.sh

运维知识 2025-06-14 13:54:17 通过 手机 浏览(521)

共有0条评论!

发表评论

更换一道题!