计划外关闭后无法在Ubuntu上安装Docker

时间:2020-08-09 17:38:45

标签: docker ubuntu-18.04

这是我的第一个问题,所以我希望我问对了。我在VirtualBox VM中运行docker(来宾操作系统是Ubuntu 18.04)

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:    18.04
Codename:   bionic

前几天,我发生了“计划外重启”(即电源故障),该重启一定损坏了某些文件,因为docker服务将不再启动。我尝试修复和修复docker,最终按照https://askubuntu.com/questions/935569/how-to-completely-uninstall-docker上的说明卸载了docker。

之后,我按照https://docs.docker.com/engine/install/ubuntu/上的标准说明从头开始重新安装了docker。

在安装的最后一步,我收到一些错误,请参见此处:

bink@bink-VirtualBox:/var/lib$ sudo apt-get install docker-ce docker-ce-cli containerd.io
Reading package lists... Done
Building dependency tree       
Reading state information... Done
containerd.io is already the newest version (1.2.13-2).
The following additional packages will be installed:
  aufs-tools cgroupfs-mount pigz
The following NEW packages will be installed:
  aufs-tools cgroupfs-mount docker-ce docker-ce-cli pigz
0 upgraded, 5 newly installed, 0 to remove and 27 not upgraded.
Need to get 63.8 kB/63.9 MB of archives.
After this operation, 282 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 cgroupfs-mount all 1.4 [6,320 B]
Fetched 63.8 kB in 0s (268 kB/s)          
Selecting previously unselected package pigz.
(Reading database ... 186105 files and directories currently installed.)
Preparing to unpack .../archives/pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../aufs-tools_1%3a4.9+20170918-1ubuntu1_amd64.deb ...
Unpacking aufs-tools (1:4.9+20170918-1ubuntu1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../docker-ce-cli_5%3a19.03.12~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce-cli (5:19.03.12~3-0~ubuntu-bionic) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../docker-ce_5%3a19.03.12~3-0~ubuntu-bionic_amd64.deb ...
Unpacking docker-ce (5:19.03.12~3-0~ubuntu-bionic) ...
Setting up aufs-tools (1:4.9+20170918-1ubuntu1) ...
Setting up cgroupfs-mount (1.4) ...
Setting up docker-ce-cli (5:19.03.12~3-0~ubuntu-bionic) ...
Setting up pigz (2.4-1) ...
Setting up docker-ce (5:19.03.12~3-0~ubuntu-bionic) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Job for docker.service canceled.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: deactivating (stop-sigterm)
     Docs: https://docs.docker.com
 Main PID: 23326 (dockerd)
    Tasks: 1
   CGroup: /system.slice/docker.service
           └─23326 [dockerd]

Aug 09 13:10:56 bink-VirtualBox systemd[1]: Starting Docker Application Container Engine...
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
Processing triggers for systemd (237-3ubuntu10.41) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) ...
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

我怀疑在计划外的重启过程中,containerd.io发生了一些变化,但是当我运行docker install时,它说containerd.io已经是最新版本,因此不会重新安装。

如果我尝试systemctl start docker,它只会返回Job for docker.service canceled.。但实际上我可以运行sudo dockerd,泊坞窗将启动。我只是无法让它作为服务启动。

有人有什么建议吗?我已经搜索了这些错误,并发现了一些稍微相似的结果,但情况与我不完全相同。我只需要重新安装containerd.io吗?如果是这样,由于系统认为它已经正确安装,该怎么办?

0 个答案:

没有答案