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 小时前
[特殊字符] 深度起底:突破火山引擎 Ark-Helper 的 Linux 底层环境死锁,顺手魔改一份 Windows 一键安装脚本!
linux·windows·火山引擎
我星期八休息14 小时前
Linux系统编程—mmap文件映射
java·linux·运维·服务器·数据库·mysql·spring
2301_7779983415 小时前
Linux:文件系统
linux
Tian_Hang15 小时前
Linux基础知识(五)
linux·运维·服务器
凡人叶枫15 小时前
Effective C++ 条款32:确定你的 public 继承塑模出 is-a(是一种)关系
java·linux·开发语言·c++·嵌入式开发
utf8mb4安全女神15 小时前
expect工具,expect脚本,实现全自动免交互登录ssh,shell脚本和expect结合使用,在多台服务器上创建1个用户【linux】
linux·运维·服务器
暮云星影15 小时前
全志开发环境搭建及编译构建
linux·arm开发·驱动开发
vortex515 小时前
Alpine Linux 运行架构解析:从内核到容器的精简之道
linux·运维·架构
三块可乐两块冰15 小时前
rag学习5
linux·前端·python
::呵呵哒::15 小时前
在macOS/Linux上优雅管理多个JDK版本:环境变量与别名配置指南
java·linux·macos