真的是闭门家中坐,祸从天上来。前两天闲来无事就点了一下upgrade,然后,apt-get工具抛锚了,问题如下:

ttt@ttt:/home$ sudo apt upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  gir1.2-gtk-2.0 libboost-program-options1.58.0 libboost-thread1.58.0
  libcairo-script-interpreter2 libgoogle-perftools4 libharfbuzz-dev
  libharfbuzz-gobject0 libjbig-dev libjpeg-turbo8-dev liblzma-dev libpcre3-dev
  libpcre32-3 libpixman-1-dev libpng16-16 libtcmalloc-minimal4 libtiffxx5
  libv8-3.14.5 libxcb-shm0-dev libxcomposite-dev libxcursor-dev
  libxinerama-dev libxrandr-dev libxrender-dev libyaml-cpp0.5v5
  x11proto-composite-dev x11proto-randr-dev x11proto-render-dev
  x11proto-xinerama-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] yes
Setting up docker-ce (5:18.09.1~3-0~ubuntu-xenial) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/dockerd-ce because link group dockerd is broken
A dependency job for docker.service failed. See 'journalctl -xe' for details.
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: active (running) since 三 2019-01-23 08:41:41 CST; 1 day 5h ago
     Docs: https://docs.docker.com
 Main PID: 23534 (dockerd)
   CGroup: /system.slice/docker.service
           └─23534 /usr/bin/dockerd -H unix://

1月 24 11:50:00 ttt systemd[1]: Dependency failed for Docker Applicatio...e.
1月 24 11:50:00 ttt systemd[1]: docker.service: Job docker.service/star...'.
1月 24 11:50:58 ttt systemd[1]: Dependency failed for Docker Applicatio...e.
1月 24 11:50:58 ttt systemd[1]: docker.service: Job docker.service/star...'.
1月 24 11:57:35 ttt systemd[1]: Dependency failed for Docker Applicatio...e.
1月 24 11:57:35 ttt systemd[1]: docker.service: Job docker.service/star...'.
1月 24 13:55:23 ttt systemd[1]: Dependency failed for Docker Applicatio...e.
1月 24 13:55:23 ttt systemd[1]: docker.service: Job docker.service/star...'.
1月 24 14:15:28 ttt systemd[1]: Dependency failed for Docker Applicatio...e.
1月 24 14:15:28 ttt systemd[1]: docker.service: Job docker.service/star...'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package docker-ce (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nvidia-docker2:
 nvidia-docker2 depends on docker-ce (= 5:18.09.1~3-0~ubuntu-xenial) | docker-ee (= 5:18.09.1~3-0~ubuntu-xenial); however:
  Package docker-ce is not configured yet.
  Package docker-ee is not installed.

dpkg: error processing package nvidia-docker2 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 docker-ce
 nvidia-docker2
E: Sub-process /usr/bin/dpkg returned an error code (1)

解决方案:
重新安装docker-ce
由于之前安装过,什么证书啊啥的都有,比重头安装要简单些,当然也可以参考官网。下面是我的修复过程

$ sudo apt-get purge -y docker-ce
$ sudo apt-get install docker.io
$ sudo apt upgrade 
$ sudo apt install nvidia-docker
$ sudo apt autoremove

应该是官方打补丁是么步骤不对,才导致这个问题,问题不大,在网上找了点资料,手动修复下就好了。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐