![存储库“base”在配置中缺少名称,使用 id CentOS5](https://linux22.com/image/684378/%E5%AD%98%E5%82%A8%E5%BA%93%E2%80%9Cbase%E2%80%9D%E5%9C%A8%E9%85%8D%E7%BD%AE%E4%B8%AD%E7%BC%BA%E5%B0%91%E5%90%8D%E7%A7%B0%EF%BC%8C%E4%BD%BF%E7%94%A8%20id%20CentOS5.png)
当我运行时,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-centos-linux-verify-rhn-rhn-repo-package-gpg-keys/
答案2
Centos 5 几个月前就已经停产了。正如你在http://mirror.centos.org/centos/5/readme :
此目录(和 CentOS 版本)已弃用。
CentOS-5 现已过期
您可以在这里获取 centos 5.11 的最新发布版本:
请注意:自从转移到 Vault 后,出于安全原因,此版本不再维护。它将存在安全问题,您应该升级到新版本。