gpt4 book ai didi

docker - 无法在 WSL 上从 Ubuntu 卸载 Docker

转载 作者:行者123 更新时间:2023-12-02 08:18:28 32 4
gpt4 key购买 nike

我尝试卸载 Docker,但总是收到错误消息。我已经在互联网上搜索过,但没有成功修复该错误。我的印象是有一些损坏的软件包,但总的来说我对 Linux 很陌生。这是结果:

sudo apt-get purge -y docker-ce 
1 ↵ 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 0 not upgraded.
1 not fully installed or removed.
After this operation, 181 MB disk space will be freed.
(Reading database ... 44147 files and directories currently installed.)
Removing docker-ce (18.03.1~ce-0~ubuntu) ...
invoke-rc.d: could not determine current runlevel
* Stopping Docker: docker start-stop-daemon: warning: failed to kill 466: No such process
No process in pidfile '/var/run/docker-ssd.pid' found running; none killed.
invoke-rc.d: initscript docker, action "stop" failed.
dpkg: error processing package docker-ce (--purge):
subprocess installed pre-removal script returned error exit status 1
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

我希望任何人都可以帮助我。 :)

最佳答案

我在尝试从 WSL 中删除 docker.io 时遇到了同样的错误,它显然是预安装的。问题是预删除脚本失败,因为 docker 从未运行过,因此无法停止。

就我而言,我对/var/lib/dpkg/info/docker.io.prerm 进行了 sudo 编辑,并将 /sbin/stop docker (失败)替换为 true (仅返回成功)。之后, apt remove docker.io 完美运行。

(我在这里找到了解决方案,2013年的老问题:docker can't be uninstalled if it never worked (Ubuntu))

关于docker - 无法在 WSL 上从 Ubuntu 卸载 Docker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51377291/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com