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
相关推荐
此生只爱蛋14 小时前
【Linux】正/反向代理
linux·运维·服务器
qq_54702617914 小时前
Linux 基础
linux·运维·arm开发
zfj32114 小时前
sshd除了远程shell外还有哪些功能
linux·ssh·sftp·shell
我只会发热15 小时前
Ubuntu 20.04.6 根目录扩容(图文详解)
linux·运维·ubuntu
爱潜水的小L15 小时前
自学嵌入式day34,ipc进程间通信
linux·运维·服务器
保持低旋律节奏15 小时前
linux——进程状态
android·linux·php
zhuzewennamoamtf15 小时前
Linux I2C设备驱动
linux·运维·服务器
zhixingheyi_tian15 小时前
Linux 之 memory 碎片
linux
邂逅星河浪漫15 小时前
【域名解析+反向代理】配置与实现(步骤)-SwitchHosts-Nginx
linux·nginx·反向代理·域名解析·switchhosts
梅尔文.古15 小时前
RaspberryPi-如何启用看门狗
linux·运维·服务器