centos7 下安装docker报错:You could try using...

时间:2021-12-15 13:30:36

搞了台VPS,想要装docker,发现死活装不上,各种报错。之前系统是centos6,发现官方现在已经不支持centos6了,遂升级到centos7,然后还是出现下面这个错误。

Error: Package: docker-engine-1.12.3-1.el7.centos.x86_64 (dockerrepo)
Requires: systemd-units
Error: Package: docker-engine-1.12.3-1.el7.centos.x86_64 (dockerrepo)
Requires: libseccomp.so.2()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

centos7 下安装docker报错:You could try using...

经过折腾一翻,已经解决了。

解决方案

  1. 下载docker的仓库源wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
  2. 下载docker rpm包 wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm
  3. 安装仓库源 sudo yum install docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
  4. 安装docker-ce sudo yum install docker-ce-17.03.2.ce-1.el7.centos.x86_64.rpm
  5. 启动docker服务 service docker start
  6. 解决!

其它参考资料

  1. 官方软件仓库 https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
  2. centos 6下安装docker方法 https://www.cnblogs.com/skyrim/p/7712556.html