前言
由于官方已经在2021/12/31停止了对CentOS 8的支持,无法获取APPSTREAM的URL列表,所以需要更新 yum 源,才能使用
方法1:
如果你仍然需要运行CentOS 8,你可以在/etc/yum.repos.d中更新一下源。使用vault.centos.org代替mirror.centos.org。:
"s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sudo sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
生成缓存
yum clean all && yum makecache
方法2:
下载阿里源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
更新源里面的地址
sed -i -e "s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum.repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
生成缓存
yum clean all && yum makecache
从CentOS 8平滑升级至CentOS Stream
# 老方法 dnf install centos-release-stream 不再推荐使用
dnf swap centos-linux-repos centos-stream-repos
dnf distro-sync
# 查看当前版本
cat /etc/centos-release
CentOS Stream release 8
建议更新后重启一下。
CentOS Stream迁移后还原回CentOS 8:
https://forums.rockylinux.org/t/centos-8-centos-stream-rocky-linux/2343/5
https://unix.stackexchange.com/questions/624494/how-to-switch-to-centos-8-from-centos-stream