存储库“base”在配置中缺少名称,使用 id CentOS5

存储库“base”在配置中缺少名称,使用 id CentOS5

当我运行时,yum update收到以下错误:

存储库“base”在配置中缺少名称,使用 id 从缓存的主机文件加载镜像速度错误:无法找到 repo 的有效 baseurl:base

我没有使用代理。有人知道如何修复吗?

答案1

您应该查看 /etc/yum.repos.d/CenOS-Base.repo 文件是否存在

如果确实如此,那么我将参考以下内容,查看基础 repo 文件中是否存在可能导致错误的内容。否则,如果文件不存在,我将使用这些设置创建文件,看看它是否适合您。

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful

[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&rep$
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

[dag]
name=Dag RPM Repository for Centos
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag

[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons
baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
enabled=1

我还会仔细检查你的 GPG 密钥 http://www.cyberciti.biz/faq/redhat-c​​entos-linux-verify-rhn-rhn-repo-package-gpg-keys/

答案2

Centos 5 几个月前就已经停产了。正如你在http://mirror.centos.org/centos/5/readme

此目录(和 CentOS 版本)已弃用。

CentOS-5 现已过期

您可以在这里获取 centos 5.11 的最新发布版本:

http://vault.centos.org/5.11/

请注意:自从转移到 Vault 后,出于安全原因,此版本不再维护。它将存在安全问题,您应该升级到新版本。

相关内容