yum 安装 epel-release 后出现yum doesn’t have enough cached data to continue错误的解决方案
2024-09-01 13:36:55
工作中需要部署docker,由于是内网环境,无法直接访问外网,于是考虑在内网搭建yum私有源进行安装,内网服务器操作系统为centos 7.4。根据docker的官方安装方式进行安装时,要求安装 epel-release 以及 container-selinux。
于是进行同步base以及epel源,reposync base && reposync epel
。
到内网环境中,通过 createrepo ./
的方式创建私有源,并在另一台服务器上逐步安装,当安装完毕epel-release后,再进行安装container-selinux时,出现错误。
已加载插件:fastestmirror
base | 3.6 kB 00:00:00
One of the configured repositories failed (未知),
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:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage:
yum-config-manager --disable <repoid>
4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
原因是安装完毕 epel-release 后, 会在 /etc/yum.repo.d/
目录中添加 epel.repo
以及 epel-testing.repo
两个配置文件,配置文件中包含 container-selinux 的yum源。
解决方法:
- 继续同步
epel.repo
中指定的yum源,并修改本地/etc/yum.repo.d/epel.repo
对应的yum源路径。 - 找一台可下载
container-selinux
相关rpm包的服务器下载关联安装包进行安装。
我目前是使用的第二种解决方案,在一台能上外网的机器中执行如下命令:
# 挂载位置轻喷 嘻嘻
sudo docker rum --rm -v /container-selinux:/data -it centos:latest /bin/bash -c "yum install -y epel-release && yum install container-selinux --downloadonly --downloaddir=/data"
然后将/container-selinux/
中container-selinux*.rpm 拷贝到目标服务器中,执行rpm安装命令即可
sudo rpm -ivh container-selinux*.rpm
由于人也比较懒,所以安装docker-ce相关的内容时也不会去配置GPG公钥,安装的时候跳过即可
sudo yum install -y docker-ce docker-ce-cli containerd.io --nogpgcheck
最新文章
- [LeetCode] Best Time to Buy and Sell Stock II
- canvas初探3:画方画圆
- <;<;<; jquery简介、开头语法、在线开发手册
- gdo图形引擎中的旋转角
- OkHttp使用介绍
- 在cocos code ide的基础上构建自己的lua开发调试环境
- C#操作FTP, FTPHelper和SFTPHelper
- Linux内核学习笔记1——系统调用原理【转】
- 用委托、匿名函数、Lambda的方式输出符合要求的数
- Android 中 ListView 常用属性合集
- There is no getter for property named &#39;userSpAndSp&#39; in &#39;class com.uauth.beans.UserSpAndSp&#39;
- java.net.URLEncode编码 与 URLDecode解码问题
- ElasticSearch 5.0及head插件安装
- vue项目webpack打包后图片路径错误
- 使用java中replaceAll方法替换字符串中的反斜杠
- 电子数据识别软件ABBYY FineReader
- 一个PE文件的逆向分析
- “全栈2019”Java第四十一章:static关键字
- Many-to-many relationships in EF Core 2.0 – Part 1: The basics
- 【Hive五】Hive函数UDF