在 CentOS 6.5 中无法使用 yum 存储库,无论是使用 baseurl 还是mirrorlist

在 CentOS 6.5 中无法使用 yum 存储库,无论是使用 baseurl 还是mirrorlist

几天以来,我无法在 CentOS 6.5 服务器中使用 Yum 检索存储库数据。我做了yum clean all十几次,全部清空,但没有解决问题。

我尝试通过限制单个基础存储库来检索内容:

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

yum --verbose update结果是 :

Loading "fastestmirror" plugin
Loading "priorities" plugin
Config time: 0.010
Yum Version: 3.2.29
Setting up Package Sacks
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"
Error: Cannot find a valid baseurl for repo: base

当我配置 abaseurl而不是 a时mirrorlist,我得到:

Loading "fastestmirror" plugin
Loading "priorities" plugin
Config time: 0.010
Yum Version: 3.2.29
Setting up Package Sacks
Determining fastest mirrors
http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

服务器 pingmirror.centos.org和我可以毫无问题地访问网络浏览器中的镜像列表和repomd.xml。禁用插件没有任何改变。给出mirrorlist403 错误和baseurl404...

rpm -q --verify -f /etc/yum.repos.d/*结果是 :

S.5....T.  c /etc/issue
.......T.  c /etc/yum.repos.d/CentOS-Base.repo
.......T.  c /etc/yum.repos.d/CentOS-Debuginfo.repo
.......T.  c /etc/yum.repos.d/CentOS-Media.repo
.......T.  c /etc/yum.repos.d/CentOS-Vault.repo
S.5....T.  c /etc/issue
.......T.  c /etc/yum.repos.d/CentOS-Base.repo
.......T.  c /etc/yum.repos.d/CentOS-Debuginfo.repo
.......T.  c /etc/yum.repos.d/CentOS-Media.repo
.......T.  c /etc/yum.repos.d/CentOS-Vault.repo
S.5....T.  c /etc/issue
.......T.  c /etc/yum.repos.d/CentOS-Base.repo
.......T.  c /etc/yum.repos.d/CentOS-Debuginfo.repo
.......T.  c /etc/yum.repos.d/CentOS-Media.repo
.......T.  c /etc/yum.repos.d/CentOS-Vault.repo
S.5....T.  c /etc/issue
.......T.  c /etc/yum.repos.d/CentOS-Base.repo
.......T.  c /etc/yum.repos.d/CentOS-Debuginfo.repo
.......T.  c /etc/yum.repos.d/CentOS-Media.repo
.......T.  c /etc/yum.repos.d/CentOS-Vault.repo
.......T.  c /etc/yum.repos.d/epel-testing.repo
.......T.  c /etc/yum.repos.d/epel.repo
.......T.  c /etc/yum.repos.d/epel-testing.repo
.......T.  c /etc/yum.repos.d/epel.repo
le fichier /etc/yum.repos.d/isv:ownCloud:community.repo n'appartient à aucun paquetage
.......T.  c /etc/yum.repos.d/jpackage.repo
le fichier /etc/yum.repos.d/jpackage.repo.rpmsave n'appartient à aucun paquetage

“n'appartient à aucun paquetage”在法语中的意思是“不属于任何包”...

我启用/禁用的任何存储库都会出现这些问题。

答案1

需要查看/etc/yum.repos.d/以下命令的内容以及输出才能进行调试:

$ rpm -q --verify -f /etc/yum.repos.d/*

我曾经遇到过类似的问题,快速的解决方案是通过将变量更改enabled0正确的yum配置文件来禁用有问题的存储库。但您的错误与任何特定的存储库无关。

相关内容