Repository epel is listed more than once in the configuration报错解决方案

有时候我们在通过SSH工具进行yum命令安装的时候,会遇到类似的报错,如下:

Repository epel is listed more than once in the configuration

到底是哪里出了问题,每次都显示这个提示,总感觉不爽。这里搬主题的测试环境为CentOS 7,主机为阿里云的。接下来分享了Repository epel is listed more than once in the configuration报错的解决方案。

图片[1]-Repository epel is listed more than once in the configuration报错解决方案-搬主题

解决方案:

1、首先cd进入对应的目录,然后打包/etc/yum.repos.d/目录下的所有文件,以备恢复使用,运行命令:zip centos7-repo.zip /etc/yum.repos.d/* ,如下图

图片[2]-Repository epel is listed more than once in the configuration报错解决方案-搬主题

2、打包完毕,再运行ls命令查看多了一个zip文件,正是我们打包的文件

[root@xx_0_15_centos yum.repos.d]# ls
centos7-repo.zip  CentOS-Base.repo  CentOS-Epel.repo  epel.repo  epel-testing.repo
[root@xx_0_15_centos yum.repos.d]# 

3、删除多余文件,运行rm -rf !(centos7-repo.zip)命令,意思是删除除.zip文件以外的所有文件,再次ls查看已经都删除了

图片[3]-Repository epel is listed more than once in the configuration报错解决方案-搬主题

4、到阿里开源镜像站点下载系统对应版本的repo文件,运行wget http://mirrors.aliyun.com/repo/Centos-7.repo命令

图片[4]-Repository epel is listed more than once in the configuration报错解决方案-搬主题

下载完后再次查看已经多出来一个centos-7.repo文件,再次运行命令清空缓存,重建缓存。

yum clean all
yum makecache

如下图

图片[5]-Repository epel is listed more than once in the configuration报错解决方案-搬主题

这时报错Repository epel is listed more than once in the configuration已经修复。

图片[6]-Repository epel is listed more than once in the configuration报错解决方案-搬主题
© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容