在Centos 7.3上安装docker的问题

时间:2019-08-21 16:50:24

标签: docker

我无法在CentOS Linux版本7.3.1611(核心)上安装Docker

1。已启用/etc/yum.repos.d/CentOS-Base.repo中的附加功能   从enabled = 0到enabled = 1   也未注释#baseurl = http://mirror.centos.org/ $ releasever / extras / $ basearch /

2。之后,我尝试运行命令“ yum -y install docker”

我遇到了错误。

错误:软件包:2:container-selinux-2.107-1.el7_6.noarch(附加)            要求:selinux-policy-base> = 3.13.1-216.el7            已安装:selinux-policy-targeted-3.13.1-102.el7.noarch(@anaconda)                selinux-policy-base = 3.13.1-102.el7            可用:selinux-policy-minimum-3.13.1-192.el7.noarch(CentOS-7-x86_64-os)                selinux-policy-base = 3.13.1-192.el7            可用:selinux-policy-minimum-3.13.1-192.el7_5.3.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.3            可用:selinux-policy-minimum-3.13.1-192.el7_5.4.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.4            可用:selinux-policy-minimum-3.13.1-192.el7_5.6.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.6            可用:selinux-policy-mls-3.13.1-192.el7.noarch(CentOS-7-x86_64-os)                selinux-policy-base = 3.13.1-192.el7            可用:selinux-policy-mls-3.13.1-192.el7_5.3.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.3            可用:selinux-policy-mls-3.13.1-192.el7_5.4.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.4            可用:selinux-policy-mls-3.13.1-192.el7_5.6.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.6            可用:selinux-policy-targeted-3.13.1-192.el7.noarch(CentOS-7-x86_64-os)                selinux-policy-base = 3.13.1-192.el7            可用:selinux-policy-targeted-3.13.1-192.el7_5.3.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.3            可用:selinux-policy-targeted-3.13.1-192.el7_5.4.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.4            可用:selinux-policy-targeted-3.13.1-192.el7_5.6.noarch(CentOS-7-x86_64-updates)                selinux-policy-base = 3.13.1-192.el7_5.6 错误:套件:2:container-selinux-2.107-1.el7_6.noarch(extras)            要求:selinux-policy> = 3.13.1-216.el7            已安装:selinux-policy-3.13.1-102.el7.noarch(@anaconda)                selinux-policy = 3.13.1-102.el7            可用:selinux-policy-3.13.1-192.el7.noarch(CentOS-7-x86_64-os)                selinux-policy = 3.13.1-192.el7            可用:selinux-policy-3.13.1-192.el7_5.3.noarch(CentOS-7-x86_64-updates)                selinux-policy = 3.13.1-192.el7_5.3            可用:selinux-policy-3.13.1-192.el7_5.4.noarch(CentOS-7-x86_64-updates)                selinux-policy = 3.13.1-192.el7_5.4            可用:selinux-policy-3.13.1-192.el7_5.6.noarch(CentOS-7-x86_64-updates)                selinux-policy = 3.13.1-192.el7_5.6 错误:套件:2:container-selinux-2.107-1.el7_6.noarch(extras)            要求:selinux-policy-targeted> = 3.13.1-216.el7            已安装:selinux-policy-targeted-3.13.1-102.el7.noarch(@anaconda)                selinux-policy-targeted = 3.13.1-102.el7            可用:selinux-policy-targeted-3.13.1-192.el7.noarch(CentOS-7-x86_64-os)                selinux-policy-targeted = 3.13.1-192.el7            可用:selinux-policy-targeted-3.13.1-192.el7_5.3.noarch(CentOS-7-x86_64-updates)                selinux-policy-targeted = 3.13.1-192.el7_5.3            可用:selinux-policy-targeted-3.13.1-192.el7_5.4.noarch(CentOS-7-x86_64-updates)                selinux-policy-targeted = 3.13.1-192.el7_5.4            可用:selinux-policy-targeted-3.13.1-192.el7_5.6.noarch(CentOS-7-x86_64-updates)                selinux-policy-targeted = 3.13.1-192.el7_5.6  您可以尝试使用--skip-broken解决此问题  您可以尝试运行:rpm -Va --nofiles --nodigest

3 个答案:

答案 0 :(得分:1)

如果您要在 aws 机器上为 centos 安装 docker,则此链接可以节省一天时间:https://www.reddit.com/r/aws/comments/f99mq1/its_impossible_to_install_docker_engine_on_aws/

<块引用>

sudo yum update -y
须藤 amazon-linux-extras 安装 docker
须藤 服务泊坞窗启动

在发出上述命令之前,请确保您删除了 repo 文件:/etc/yum.repos.d/docker-ce.repo

答案 1 :(得分:0)

安装Docker Centos7

运行

curl -fsSL https://get.docker.com/ | sh
sudo systemctl start docker
sudo systemctl status docker
sudo systemctl enable docker
sudo usermod -aG docker $USER

重新启动外壳并运行

docker info

答案 2 :(得分:-1)

yum repolist -v的输出是什么?您是否可以尝试安装selinux-policy rpm软件包:# yum install selinux-policy可以如下所示显示SELinux(增强安全性的Linux)的状态。 (默认启用)运行此getenforce,我们将从那里获取