现象

使用命令yum install git时,报如下错误:

[root@centos8 ~]# yum install git
Repository AppStream is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository fasttrack is listed more than once in the configuration
上次元数据过期检查:0:04:46 前,执行于 2022年06月18日 星期六 13时04分03秒。
未找到匹配的参数: git
错误:没有任何匹配: git

解决办法

1.备份

cd /etc/yum.repos.d && mkdir bak  && mv *.repo ./bak

2.换源
有些教程给出的换源网址已经不能再使用,建议查看官网

https://developer.aliyun.com/mirror/centos

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

3.清理,生成缓存

yum clean all
yum makecache
最后修改:2022 年 10 月 26 日 10 : 57 AM
赞赏必须赞赏,多多益善,老板一直发大财!