快捷搜索:   nginx

Centos8报Repository AppStream is listed more than once in the configuration

Centos8报

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
的解决办法

CENTOS8使用dnf install 或者yum update都出现这个错误提示

分析上面的报错, 主要还是软件源 出了问题, 于是我们先进入软件源配置文件所在的目录下:

cd /etc/yum.repos.d/

ls 查看一下, 回显如下:

[root@localhost yum.repos.d]# ls
CentOS8-Base-163.repo    CentOS-CR.repo         CentOS-Media.repo
CentOS-Base.repo         CentOS-Debuginfo.repo  CentOS-Sources.repo
CentOS-Base.repo.backup  CentOS-fasttrack.repo  CentOS-Vault.repo
[root@localhost yum.repos.d]#

从对报错内容的分析来看, 应该是软件源有重复(“listed more than once”), 所以我们删除一些上面的软件源配置文件.
在删除之前,最好先对 /etc/yum.repos.d/ 目录下的文件全部进行备份, 以防失败, 操作过程如下:
将 /etc/yum.repos.d/ 目录下的文件整体压缩成一个 .zip 文件:

zip centos7-repo.zip /etc/yum.repos.d/*

然后执行删除操作:

rm -rf CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo


之后把 CentOS8-Base-163.repo 中的内容复制进 CentOS-Base.repo:

cp -p CentOS8-Base-163.repo CentOS-Base.repo


最后删除 CentOS8-Base-163.repo:

rm -rf CentOS8-Base-163.repo


之后运行如下命令重建缓存, 没有再出现"Repository base is listed more than once in the configuration"的报错:

yum clean all
yum makecache


顶(0)
踩(1)

您可能还会对下面的文章感兴趣:

最新评论