CentOS8无法正常使用阿里云YUM源

发布于 2 年前 作者 phonegap100 1512 次浏览 最后一次编辑是 1 年前 来自 分享

CentOS8无法正常使用阿里云YUM源的解决办法

说明 由于centos8 在2022年停止服务,后继版本为8-steam。在使用阿里云的 centos8 的 yum 时报错。 错误如下所示:

Cannot download repomd.xml: Cannot download repodata/repomd.xml 解决方法 删除 /etc/yum.repos.d 目录中的所有文件, /etc/yum.repos.d 目录中的新建CentOS-Base.repo ,CentOS-Base.repo内容如下。 新内容如下:


[base]
name=CentOS-8-stream - Base - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful
[extras]
name=CentOS-8-stream - Extras - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/extras/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-8-stream - Plus - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[PowerTools]
name=CentOS-8-stream - PowerTools - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[AppStream]
name=CentOS-8-stream - AppStream - mirrors.aliyun.com
baseurl=https://mirrors.aliyun.com/centos/8-stream/AppStream/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

然后执行下面的命令

yum clean all
yum makecache

执行完成后,即可正常使用 YUM。

回到顶部