CentOS8 yum源安装软件出现问题解决办法

进行yum makecache时出现一下问题
在这里插入图片描述
感觉是源镜像库出l问题,于是百度后要更换yum镜像源的baseurl

cd /etc/yum.repo.d
vim CentOS-Linux-AppStream.repo

CentOS7配置文件名叫CentOS-AppStream.repo,有点坑。搞得自己vim时创建了新的配置文件,yum时又出现了多个镜像源冲突的问题。

CentOS8叫以下
CentOS-Linux-AppStream.repo 配置文件
在这里插入图片描述

[appstream]
name=CentOS Linux $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirrors.cloud.aliyuncs.com/$contentdir/$releasever/AppStream/$basearch/os/
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

百度上很多关于这个问题都是把地址换成

baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/

但是我试了很多次都没有效果,最后看到一片博主写的才最后解决
https://blog.csdn.net/weixin_40548480/article/details/122772932
后面发现要把地址加上$releasever-stream,换成如下才解决

baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/

然后执行yum makecache又出现了新的问题
在这里插入图片描述

Errors during downloading metadata for repository 'baseos':
  - Status code: 404 for https://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/repodata/repomd.xml (IP: 106.15.218.231)
Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

很明显,是BaseOS出现了问题
如法炮制
找到CentOS-Linux-BaseOS.repo配置文件
在这里插入图片描述
把baseurl换成

#baseurl=http://mirrors.cloud.aliyuncs.com/$contentdir/$releasever/BaseOS/$basearch/os/
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/BaseOS/$basearch/os/

最后执行

yum clean all
yum makecache

搞定
在这里插入图片描述
这个问了折腾了两个小时才解决,网上大多数关于这个问题的解决办法都是比较相同,没找到有效的解决办法。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值