安装包集合:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/

此次安装用到了列表中的:

白天虚拟机上,竟然只安装 docker-ce-18.09.4-3.el7.x86_64.rpm 就可以了,结果晚上云服务器上陆续出现下面的问题

  1. 尝试直接安装 docker-ce-18.09.4-3.el7.x86_64.rpm

     [root@iZ286t0wuf9Z ftp_user]# yum install ./docker-ce-18.09.4-3.el7.x86_64.rpm
     Loaded plugins: fastestmirror
     Examining ./docker-ce-18.09.4-3.el7.x86_64.rpm: 3:docker-ce-18.09.4-3.el7.x86_64
     Marking ./docker-ce-18.09.4-3.el7.x86_64.rpm to be installed
     **************此处省略一大堆输出**************
     --> Finished Dependency Resolution
     Error: Package: 3:docker-ce-18.09.4-3.el7.x86_64 (/docker-ce-18.09.4-3.el7.x86_64)
                Requires: docker-ce-cli
     Error: Package: 3:docker-ce-18.09.4-3.el7.x86_64 (/docker-ce-18.09.4-3.el7.x86_64)
                Requires: containerd.io >= 1.2.2-3
      You could try using --skip-broken to work around the problem
     ** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
     2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit)
     2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit)
     [root@iZ286t0wuf9Z ftp_user]#
    
  2. 根据提示,“Requires: docker-ce-cli”“Requires: containerd.io >= 1.2.2-3”,所以安装了前面提到的另外两个 rpm 文件。

     [root@iZ286t0wuf9Z ftp_user]# yum install containerd.io-1.2.5-3.1.el7.x86_64.rpm
     **************此处省略一大堆输出**************
     [root@iZ286t0wuf9Z ftp_user]# yum install docker-ce-cli-18.09.4-3.el7.x86_64.rpm
     **************此处省略一大堆输出**************
     [root@iZ286t0wuf9Z ftp_user]#
    
  3. 再尝试安装 docker-ce-18.09.4-3.el7.x86_64.rpm

     [root@iZ286t0wuf9Z ftp_user]# yum install ./docker-ce-18.09.4-3.el7.x86_64.rpm
     Loaded plugins: fastestmirror
     Examining ./docker-ce-18.09.4-3.el7.x86_64.rpm: 3:docker-ce-18.09.4-3.el7.x86_64
     Marking ./docker-ce-18.09.4-3.el7.x86_64.rpm to be installed
     Resolving Dependencies
     **************此处省略一大堆输出**************
     Downloading packages:
     Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
    
    
     Error downloading packages:
       selinux-policy-targeted-3.13.1-229.el7_6.9.noarch: [Errno 5] [Errno 12] Cannot allocate memory
     **************此处省略一大堆输出**************
       libsepol-devel-2.5-10.el7.x86_64: [Errno 5] [Errno 12] Cannot allocate memory
    
  4. 根据提示 “because /usr/bin/applydeltarpm not installed”,所以如下操作

     [root@iZ286t0wuf9Z ftp_user]# yum provides '*/applydeltarpm'
     Loaded plugins: fastestmirror
     Loading mirror speeds from cached hostfile
     base/7/x86_64/filelists_db
     | 7.1 MB  00:00:00
     epel/x86_64/filelists_db
     |  11 MB  00:00:00
     extras/7/x86_64/filelists_db
     | 236 kB  00:00:00
     updates/7/x86_64/filelists_db
     | 2.7 MB  00:00:00
     deltarpm-3.6-3.el7.x86_64 : Create deltas between rpms
     Repo        : base
     Matched from:
     Filename    : /usr/bin/applydeltarpm
    

    原来是 deltarpm-3.6-3.el7.x86_64 的问题,所以继续操作

     [root@iZ286t0wuf9Z ftp_user]# yum install deltarpm
     Loaded plugins: fastestmirror
     Loading mirror speeds from cached hostfile
     Resolving Dependencies
     --> Running transaction check
     ---> Package deltarpm.x86_64 0:3.6-3.el7 will be installed
     --> Finished Dependency Resolution
     **************此处省略一大堆输出**************
     Complete!
    
  5. 最后一次尝试安装 docker-ce-18.09.4-3.el7.x86_64.rpm

     [root@iZ286t0wuf9Z ftp_user]# yum install docker-ce-18.09.4-3.el7.x86_64.rpm
     Loaded plugins: fastestmirror
     Examining docker-ce-18.09.4-3.el7.x86_64.rpm: 3:docker-ce-18.09.4-3.el7.x86_64
     Marking docker-ce-18.09.4-3.el7.x86_64.rpm to be installed
     Resolving Dependencies
     **************此处省略一大堆输出**************
     Complete!
     [root@iZ286t0wuf9Z ftp_user]#
    

愉快完成

参考:官方文档

04-10 06:01