I tried to install Docker CE for Ubuntu in the Windows Subsystem for Linux, and I had trouble getting it to work properly. I discovered that perhaps Docker doesn't work in WSL, so now I'm trying to remove it.
I've successfully removed GPG keys and Docker repo from apt, but I'm getting the following error when I try to remove the Docker package:
~ sudo apt-get --purge remove 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 4 not upgraded. 1 not fully installed or removed. After this operation, 85.4 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 36248 files and directories currently installed.) Removing docker-ce (5:18.09.6~3-0~ubuntu-bionic) ... invoke-rc.d: could not determine current runlevel * Stopping Docker: docker start-stop-daemon: warning: failed to kill 4129: 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 (--remove): installed docker-ce package pre-removal script subprocess returned error exit status 1 dpkg: error while cleaning up: installed docker-ce package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: docker-ce E: Sub-process /usr/bin/dpkg returned an error code (1)1
1 Answer
Somehow the /var/run/docker-ssd.pid file identified a process id for a process that either failed to start or was killed without cleaning up the file.
However it came to be, removing this file allowed the cleanup to finish.
~ sudo rm /var/run/docker-ssd.pid
~ sudo apt-get --purge remove 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 4 not upgraded.
1 not fully installed or removed.
After this operation, 85.4 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 36058 files and directories currently installed.)
Removing docker-ce (5:18.09.6~3-0~ubuntu-bionic) ...
invoke-rc.d: could not determine current runlevel * Docker already stopped - file /var/run/docker-ssd.pid not found.
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
(Reading database ... 36048 files and directories currently installed.)
Purging configuration files for docker-ce (5:18.09.6~3-0~ubuntu-bionic) ...
Processing triggers for ureadahead (0.100.0-21) ...
Processing triggers for systemd (237-3ubuntu10.21) …
~ docker
zsh: command not found: dockerAn interesting side note: perhaps the issue is not, in fact, with WSL. It looks like others have run into similar problems and been able to resolve them. See Docker for Linux GitHub issue #52: Package modification by apt fails on Linux Subsystem for Windows