在redhat上,无法安装Docker

分享于 

5分钟阅读

互联网

  繁體

问题:

操作系统详细信息:


cat /etc/redhat-release



Red Hat Enterprise Linux服务器版本7.4 (Maipo )

 
uname -r



3.10.0 -693.58.1.el7.x86_64


sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo



然后这个


sudo yum install docker-ce



但是出现这个错误。

Loaded plugins : langpacks, product-id, search-disabled-repos : [Errno 14] HTTPS Error 404 - not Found trying other mirror. 要解决这个问题,请参阅以下知识库文章

https://access.redhat.com/articles/1320623

if above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

rhel-7-server-rpms |3.4 kB 00:00:00 rhui-microsoft-azure-rhel7-eus|2.1 kB 00:00:00 rhui-rhel-7-server-dotnet-rhui-rpms|2.3 kB 00:00:00 rhui-rhel-7-server-rhui-eus-optional-rpms|1.8 kB 00:00:00 rhui-rhel-7-server-rhui-eus-rpms|2.0 kB 00:00:00 rhui-rhel-7-server-rhui-eus-supplementary-rpms|2.0 kB 00:00:00 rhui-rhel-7-server-rhui-rh-common-rpms|2.1 kB 00:00:00 rhui-rhel-server-rhui-rhscl-7-rpms| 2.0 kB 00:00:00 Resolving Dependencies -- > Running transaction check --- > Package docker-ce.x86_64 3:19.03.12-3.el7 will be installed -- > Processing Dependency : container-selinux > = 2:2.74 for package : 3:docker-ce-19.03.12-3.el7.x86_64 -- > Processing Dependency : 软件包的containerd.io > =1.2.2 -3:3:docker-ce-19.03.12-3.el7.x86_64 -- > Processing Dependency : docker-ce-cli for package : 3:docker-ce-19.03.12-3.el7.x86_64 -- > Running transaction check --- > Package containerd.io.x86_64 0:1.2.13-3.2.el7 will be installed -- > Processing Dependency : container-selinux > = 2:2.74 Error : > =2:2.74用于包:容器号.io-1.2.13-3.2.el7.x86_64--->包docker-ce.x86_64 3:19.03.12-3.el7被安装-->处理依赖:container-selinux > = 2:2.74 Error : > =2:2.74用于包:3:docker-ce-19.03.12-3.el7.x86_64 --- > Package docker-ce-cli.x86_64 1:19.03.12-3.el7 will be installed -- > Finished Dependency Resolution Error : Package : containerd.io-1.2.13-3.2.el7.x86_64 (docker-ce-stable) Requires : container-selinux > = 2:2.74 Error : Package : 3:docker-ce-19.03.12-3.el7.x86_64 (docker-ce-stable) Requires : container-selinux > = 2:2.74 ********************************************************************** yum can be configured to try to resolve such errors by temporarily enabling disabled repos and searching for missing dependencies. to enable this functionality please set'notify_only=0'in /etc/yum/pluginconf.d/search-disabled-repos.conf

Error : Package : containerd.io-1.2.13-3.2.el7.x86_64 (docker-ce-stable) Requires : container-selinux > = 2:2.74 Error : Package : 3:docker-ce-19.03.12-3.el7.x86_64 (docker-ce-stable) Requires : container-selinux > = 2:2.74 you could try using --skip-broken to work around the problem you could try running : rpm -Va --nofiles --nodigest


答案1:

Docker CE目前需要RHEL/CentOS 7.6或更高版本,你需要从7.4升级操作系统。


答案2:

你可以使用centos存储库而不是Redhat。禁用刚刚添加的存储库yum-config-manager --disable repository 运行,


# yum -y remove docker-common docker container-selinux docker-selinux docker-engine


# yum -y install lvm2 device-mapper device-mapper-persistent-data device-mapper-event device-mapper-libs device-mapper-event-libs


# yum -y install wget


# wget https://download.docker.com/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo



启用rhel-7-server-extras-rpms存储库,


# subscription-manager repos --enable=rhel-7-server-extras-rpms



最后


yum -y install docker-ce




答案3

确保删除旧的软件包。


yum -y remove docker-common docker container-selinux docker-selinux docker-engine





DOC  RED  Docker  DOCK  Redhat