工作中需要部署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源。

解决方法:

  1. 继续同步epel.repo中指定的yum源,并修改本地/etc/yum.repo.d/epel.repo对应的yum源路径。
  2. 找一台可下载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

yum 安装 epel-release 后出现yum doesn’t have enough cached data to continue错误的解决方案的更多相关文章

  1. yum安装epel库后,安装软件总是提示Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again(无法检索epel仓库)

    解决方法: vi /etc/yum.repos.d/epel.repo 将baseurl中的注释取消,将mirrorlist该列注释掉即可. 附图如下:

  2. CentOS7用yum安装wget命令后仍然提示命令找不到的解决方法

    需求:用的AWS实例自带的CentOS7用yum安装wget命令后扔提示命令找不到,后面用源码安装方式解决,下面先讲解决方法,疑问及知识点扩展最后写出 1.问题(因是mini版本系统,有些基本命令扔需 ...

  3. yum install 安装时报yum doesn't have enough cached data to continue.

    yum install 安装时报yum doesn't have enough cached data to continue. 安装epel,yum -y install epel-release后 ...

  4. yum安装epel源

    国内yum源的安装(163,阿里云,epel)   国内yum源的安装(163,阿里云,epel) ----阿里云镜像源 1.备份 mv /etc/yum.repos.d/CentOS-Base.re ...

  5. 用yum安装完mysql后没有mysqld的问题

    在Centos中用命令 yum install mysql安装数据库,但装完后运行mysqld启动mysql的时候提示找不到,通过 find / | grep mysqld 也没找到mysqld的目录 ...

  6. 02: 安装epel 解决centos7无法使用yum安装nginx

    参考网址: http://www.mamicode.com/info-detail-1671603.html 1.yum命令安装 yum install epel-release -y 2.更新数据 ...

  7. 【Linux】CentOS7 上使用yum安装和卸载软件【yum安装wine举例】

    关于yum的相关解释,请 man yum 自行查看. 配置常用源:http://www.cnblogs.com/sxdcgaq8080/p/7516186.html yum的使用类似于在windows ...

  8. Centos7:yum安装MySQL5.7后如何设置root密码

    Centos下安装软件的方式很简单,只需要通过yum install xxx命令即可.第一步当然检查是否有mysql的yum源,命令:yum list|grep mysql-community[主要还 ...

  9. CentOS6.5 安装Python2.7后, yum出现“No module named yum”错误

    安装如下方法安装python2.7: yum install –y python27 python27-devel python-docutils cd /usr/bin/ rm -rf python ...

随机推荐

  1. 接口测试命令Httpie的使用

    相比于curl命令,Httpie提供更清晰友好的界面,并支持授权,代理等操作 主要特性 直观的语法 格式化和色彩化的终端输出 内置 JSON 支持 支持上传表单和文件 HTTPS.代理和认证 任意请求 ...

  2. 解决跨操作系统平台JSON中文乱码问题

    解决跨操作系统平台JSON中文乱码问题 LINUX统一使用utf-8编码,WINDOWS却不是. LINUX中间件,传输JSON给WINDOWS程序,会乱码. 解决办法: 对JSON字段是字符串类型的 ...

  3. arcgis 地理坐标系 699个,投影坐标系是4767

    import arcpy # Get the list of spatial references and print it. srs = arcpy.ListSpatialReferences(sp ...

  4. 阿里巴巴微服务与配置中心技术实践之道 原创: 坤宇 InfoQ 2018-02-08

    阿里巴巴微服务与配置中心技术实践之道 原创: 坤宇 InfoQ 2018-02-08

  5. Web前端接入人机识别验证码---腾讯防水墙

    Web前端接入 1. 准备AppID 验证码接入需要先在管理后台中注册获取APPID和APPSECRET,注册步骤请参考 快速开始 2. 快速接入步骤 1.在Head的标签内最后加入以下代码引入验证J ...

  6. Android:修改连接到AP端显示的设备名

    一.Android系统代码中实现设备名分配 1. \frameworks\base\services\core\java\com\android\server\ConnectivityService. ...

  7. python小白之np功能快速查

    np一些用法 np.a np.array([1,2,3],dtype=int)  #建立一个一维数组, np.array([[1,2,3],[2,3,4]])  #建立一个二维数组. np.arang ...

  8. Django之数据库对象关系映射

    Django ORM基本配置 到目前为止,当我们的程序涉及到数据库相关操作时,我们一般都会这么搞: 创建数据库,设计表结构和字段 使用 MySQLdb 来连接数据库,并编写数据访问层代码 业务逻辑层去 ...

  9. 阶段5 3.微服务项目【学成在线】_day09 课程预览 Eureka Feign_14-课程预览功能开发-CMS添加页面接口

    5.3 CMS添加页面接口 cms服务对外提供添加页面接口,实现:如果不存在页面则添加,否则就更新页面信息. 此接口由课程管理服务在课程预览时调用. 接口方法.:页面没有就添加.有了更新数据 之前的接 ...

  10. Qt编写输入法V2019终极版

    一.前言 之前写过的V2018版本的输入法,本来已经很完善了,不打算更新升级了,最近有个朋友找我定制一个输入法,需要高仿一个苹果MAC电脑的输入法,MAC操作系统的审美无疑是相当棒的,于是乎直接拿以前 ...