Linux 中CentOS Stream 8 - yum -y update 异常报错问题

【错误内容】

【解决方法】 使用阿里云或其他第三方镜像源来替代默认的 CentOS 镜像。阿里云提供了稳定的 CentOS 镜像。

修改 CentOS-Linux-BaseOS.repo 和 CentOS-Linux-AppStream.repo 中的 baseurl 为阿里云的镜像地址:

bash 复制代码
sudo vi /etc/yum.repos.d/CentOS-Linux-BaseOS.repo

更改为:

ini 复制代码
[baseos]
name=CentOS Stream $releasever - BaseOS
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$stream/BaseOS/$basearch/os/
baseurl=http://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/
gpgcheck=1
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

对于 CentOS-Linux-AppStream.repo 也是类似的修改:

bash 复制代码
sudo vi /etc/yum.repos.d/CentOS-Linux-AppStream.repo

更改为:

ini 复制代码
[appstream]
name=CentOS Stream $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/
baseurl=http://mirrors.aliyun.com/centos/8/AppStream/x86_64/os/
gpgcheck=1
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

对于 CentOS-Stream-Extras.repo 也是类似的修改:

arduino 复制代码
sudo vi /etc/yum.repos.d/CentOS-Stream-Extras.repo

更改为:

ini 复制代码
[extras]
name=CentOS Stream $releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$stream/extras/$basearch/os/
baseurl=http://mirrors.aliyun.com/centos/8/extras/x86_64/os/
gpgcheck=1
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8

保存并退出。

清理 yum 缓存并更新:

sql 复制代码
yum clean all
yum -y update
相关推荐
梅见十柒1 小时前
Linux/UNIX系统编程手册笔记:POSIX
linux·服务器·网络·笔记·tcp/ip·udp·unix
---学无止境---1 小时前
Linux最忙CPU组查找函数和最忙运行队列查找函数
linux
IT成长日记2 小时前
【Nginx开荒攻略】静态文件服务深度解析:MIME类型映射与优化实战
linux·运维·服务器·nginx·mime
武大打工仔3 小时前
如何使用 Alacritty 让你的 macOS 终端更加出色
linux
深思慎考3 小时前
LinuxC++——etcd分布式键值存储系统入门
linux·c++·etcd
爱倒腾的老唐3 小时前
02、命令行的介绍
linux·bash
mahuifa4 小时前
C++(Qt)软件调试---Linux动态库链接异常排查(38)
linux·c++·动态库·ldd·异常排查
深思慎考4 小时前
LinuxC++——etcd分布式键值存储系统API(libetcd-cpp-api3)下载与二次封装
linux·c++·etcd
前方一片光明5 小时前
Linux—升级openssh常见的问题与解决方案
linux·运维·服务器
siriuuus6 小时前
Linux rsyslog 日志服务及日志转发实践
linux·rsyslog