【问题标题】:Can't uninstall docker-ce (and can't install any new programs)无法卸载 docker-ce(也无法安装任何新程序)
【发布时间】:2019-04-16 05:14:18
【问题描述】:

我在 WSL Linux (Ubuntu 16.04.5 LTS) 上安装了 docker。我试过卸载它,但它拒绝让步。以下是问题:

首先检查docker是否存在:

$ dpkg -l | grep -i docker
pFR docker-ce                            5:18.09.4~3-0~ubuntu-xenial                amd64        Docker: the open-source application container engine

尝试删除 docker-ce:

$ sudo apt-get purge -y docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  docker-ce*
0 upgraded, 0 newly installed, 1 to remove and 146 not upgraded.
1 not fully installed or removed.
After this operation, 85.4 MB disk space will be freed.
dpkg: error processing package docker-ce (--purge):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

还有致命一击 - 尝试安装任何新程序:

$ sudo apt-get install sysvbanner
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 docker-ce : Depends: docker-ce-cli but it is not going to be installed
             Depends: containerd.io (>= 1.2.2-3) but it is not going to be installed
             Recommends: aufs-tools but it is not going to be installed
             Recommends: cgroupfs-mount but it is not going to be installed or
                         cgroup-lite but it is not going to be installed
             Recommends: pigz but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

并尝试按照建议使用apt-get -f install 修复安装:

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  containerd.io docker-ce-cli
The following NEW packages will be installed:
  containerd.io docker-ce-cli
0 upgraded, 2 newly installed, 0 to remove and 146 not upgraded.
1 not fully installed or removed.
Need to get 0 B/50.3 MB of archives.
After this operation, 157 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package docker-ce-cli.
(Reading database ... 69776 files and directories currently installed.)
Preparing to unpack .../docker-ce-cli_5%3a18.09.4~3-0~ubuntu-xenial_amd64.deb ...
Unpacking docker-ce-cli (5:18.09.4~3-0~ubuntu-xenial) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../containerd.io_1.2.5-1_amd64.deb ...
Unpacking containerd.io (1.2.5-1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up docker-ce-cli (5:18.09.4~3-0~ubuntu-xenial) ...
Setting up containerd.io (1.2.5-1) ...
dpkg: error processing package docker-ce (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

请。停下来。如果我可以这么随意的话。

【问题讨论】:

标签: docker ubuntu windows-subsystem-for-linux


【解决方案1】:

我用以下命令解决了这个问题:

sudo apt-get install docker-ce
sudo apt-get purge docker docker.io docker-ce
sudo apt autoremove

然后我可以安装新程序:

sudo apt-get install php -y

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-08
    • 1970-01-01
    • 2019-07-19
    • 2019-12-13
    • 1970-01-01
    • 2016-03-08
    相关资源
    最近更新 更多