工作中需要部署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. scala 递归读取文件夹下所有的指定后缀的文件

    def getFile(file:File): Array[File] ={ val files = file.listFiles().filter(! _.isDirectory) .filter( ...

  2. BZOJ2716天使玩偶

    不会KD-tree怎么办?CQD硬搞. 建立正常的平面直角坐标系,首先我们只考虑在目标点左下角的点对目标点的贡献,由于左下点的横纵坐标都小于目标点,那么曼哈顿距离就可以化简了,绝对值去掉后,得到$x2 ...

  3. JDBC的概述和简单使用

    1. 概念 JDBC是 Java DataBase Connectivity 的简写,翻译过来就是 Java 操作数据库. 目的是使用统一的Java代码操作所有关系型数据库. JDBC实际是定义了一套 ...

  4. 数据库——JavaWEB数据库连接

    一.数据库连接的发展 1.数据库连接 用户每次请求都需要向数据库获得链接,而数据库创建连接通常需要消耗相对较大的资源,创建时间也较长.假设网站一天10万访问量,数据库服务器就需要创建10万次连接,极大 ...

  5. IOS添加真机调试设备

    注意点: 有时需要同意协议什么的,很多时候刷新出来都是白屏,解决办法: 对于不能确认新协议的问题,我发现了一个解决方法:登陆后,直接在浏览器的地址框访问:https://developer.apple ...

  6. WebSocketSharp 创建客户端和服务端

    这里没有对onOpen.onClose.onError做案例,生产环境需要具备. 1.客户端 只推送不接收数据 创建WebSocketClient类 class WebSocketClient { W ...

  7. 安装openssh-server报Depends: openssh-client (= 1:6.6p1-2ubuntu2.8)错误

    SFTP称作“安全的FTP”,它使用ssh文件传输协议.所以我们需要安装openssh-server ubuntu自带的有openssh-client,所以可以通过 ssh username@host ...

  8. Cookie 概述

    一.属性介绍 Name Cookie的key Value Cookie的value Domain 可以访问此Cookie的域名 Path 可以访问此Cookie的页面路径 Expires/Max-Ag ...

  9. 多线程-Thread和ThreadPool

    多线程原理 多线程都是基于委托的. 多线程优缺点 缺点: 1.导致程序复杂,开发调试维护困难,特别是线程交互. 2.线程过多导致服务器卡死,因为占用CPU 内存等资源. 优点: 1.良好的交互,特别对 ...

  10. python 设计模式之模板方法模式

    1.模板方法模式定义 模板模式定义如下:定义一个操作中的算法的框架,而将一些步骤延迟到子类中,使得子类可以不改变一个算法的结构即可重新定义该算法的某些特定的步骤.子类实现的具体方法叫作基本方法,实现对 ...