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
相关推荐
ouynagda7 分钟前
Linux Socket 网络编程学习笔记
linux·网络·学习
昌原的儿子LEO15 分钟前
【Linux网络编程】TCP套接字核心函数详解|三次握手|send/recv/listen/accept接口梳理
linux·网络·tcp/ip
筝筝ba21 分钟前
extended/factory_reset.robot
linux·运维·服务器·网络·网络协议·p2p
wangduqiang74725 分钟前
如何借助AI申请专利不依靠代理机构
linux
子有内涵33 分钟前
【Linux】C++ 实现可扩展 TCP 服务器|回响、字典、远程命令
linux·运维·服务器
新兴AI民工38 分钟前
# 【Linux内核三十六】进程管理模块:CFS负载均衡(一):sched_domain与sched_group层级构建
linux·运维·负载均衡
pride.li42 分钟前
WSL教程-WSL安装与配置Ubuntu
linux
躺不平的理查德1 小时前
Nginx与Ajax 备忘录
linux·运维·服务器
惜离殇1 小时前
从零开始的敲代码生活--Linux应用软件(文件操作基础2)
linux·文件io·目录io
Sunqk56651 小时前
将开发板串口连接到Ubuntu后未找到对应的设备文件?
linux·运维·ubuntu