我们在我们公司使用定制的 yum 存储库。某些原因导致他们无法执行
yum makecache
命令。
我在
CentOS Linux release 7.7.1908 (Core)
。
这是我们运行时遇到的错误
yum makecache
:
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this
存储库看起来像这样,我需要同时使用它们。
Epel 仓库:
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
我们公司回购:
[mmp]
name=MMP
baseurl=http://10.245.19.168/mmp_repo/
gpgcheck=0
enabled=1
我不确定问题是什么。我怎样才能让这个错误消失?
这似乎是 EPEL 存储库的问题。尝试 yum
--disablerepo=epel\*
直到他们解决这个问题。
如果您没有立即需要从 EPEL 获取软件包,请使用 yum 和
--disablerepo=epel
直到您的本地镜像同步。 yum clean all 可能有帮助,也可能没有帮助,具体取决于你击中的镜子。
不过,我的一般建议仍然有效——除非您立即需要获取 EPEL 软件包,否则我建议使用
--disablerepo=epel
直到您的本地镜像获得固定的repodata。如果您确实需要 EPEL 软件包并且
yum clean all
没有帮助,您需要调整配置以指向某个具有固定内容的特定镜像,例如添加baseurl=http://ftp.funet.fi/pub/mirrors/fedora.redhat.com/酒吧/epel/7/
$basearch 到 epel.repo。不过,大多数镜子现在应该已经更新了。
当有人抱怨这个问题时,我碰巧在 Freenode 频道 #epel 上,但如果这发生在我身上,我可以一次启用一个存储库(使用 --disablerepo=* 和 --enablerepo=somerepo)找出哪个存储库导致了问题。
对于非关键存储库,skip_if_unavailable=1 听起来是个好主意。
很多人只需要 EPEL 的几个软件包。一种选择是将您需要的 EPEL 包导入到某个本地控制的存储库并使用它。 createrepo 与此相关。 顶部
这个问题已经解决了这里。首先,介绍一些背景知识:当 yum 安装软件包时,它会解压所有文件并将其移动到正确的目录(即
opt
、bin
、etc
等)。当网络连接中断,驱动器写入停止时,你有什么办法,在安装过程中,有些文件可能没有被写入,而程序仍然返回安装成功。
要解决此问题:
在安装失败的主机上,检查repos是否正确。
尤其是基本网址
# grep 'baseurl' /etc/yum.repos.d/* | grep HDP
只需在 URL 中附加“/repodata/repomd.xml”,然后测试是否可以访问。
示例:如果 baseurl 是
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0
,则尝试按以下方式访问它以验证访问权限。请检查所有网址
# curl -v http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.6.3.0/repodata/repomd.xml
如果 URL 可以访问,那么在这种情况下,请尝试通过运行命令来清理 yum 缓存。
# yum clean all
在 yum clean 后,尝试再次运行以下命令以验证问题是否仍然存在。
# yum -y install ranger_2_6_3_0_235-admin
检查您的网络连接。如果您看不到系统 IP 地址,那么您应该检查并正确建立网络连接。
我遇到了这个问题。我在VMware中使用CentOS 7。如果我执行“ifconfig”命令,它只会显示一个IP地址。但通常在VM ware中它应该显示两个IP地址。因此,如果您只能看到一个 IP 地址,请关闭您的 Linux 系统。然后在 VM ware 中更改网络设置(网络适配器)。
试试这个,它会起作用...!
出现此错误的原因是官方镜像上的 CentOS 7 存储库可能因 CentOS 7 生命周期结束 (EOL) 而已被弃用或移动。解决方法如下:
CentOS 在 EOL 后在保管库存储库中维护旧版本。更新存储库文件以使用保管库 URL:
编辑基础存储库文件:
sudo vi /etc/yum.repos.d/CentOS-Base.repo
将mirror.centos.org URL 替换为vault.centos.org。例如:
baseurl=http://vault.centos.org/7.9.2009/os/x86_64/
确保更新所有部分(例如,[基础]、[更新]、[额外])。
清除缓存的元数据以确保它获取新的元数据:
sudo yum clean all
sudo yum makecache
重试之前的 yum 命令以查看是否解决问题:
sudo yum update