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
相关推荐
wj30558537820 小时前
Codex + Git 开发环境配置指南(WSL版)
linux·运维·git
星马梦缘20 小时前
如何切换window-ubuntu双系统【方案二】
linux·运维·ubuntu
丑八怪大丑1 天前
Java网络编程
linux·服务器·网络
橙子也要努力变强1 天前
信号捕捉底层机制-机理篇2
linux·服务器·c++
秋91 天前
MySQL 8.0.46 全平台安装与配置详解(Windows/Linux/macOS)
linux·windows·mysql
小康小小涵1 天前
基于ESP32S3实现无人机RID模块底层源码编译
linux·开发语言·python
CQU_JIAKE1 天前
4.28~4.30【Q】
linux·运维·服务器
左手厨刀右手茼蒿1 天前
Linux 内核中的设备驱动开发:从字符设备到网络设备
linux·嵌入式·系统内核
先知后行。1 天前
Linux 设备模型和platform平台
linux·运维·服务器
lzh200409191 天前
深入理解进程:从PCB内核结构到写时拷贝的底层实战
linux·c++