Я попытался установить Docker CE для Ubuntu в подсистеме Windows для Linux, и у меня возникли проблемы с его правильной работой. Я обнаружил, что, возможно, Docker не работает в WSL , поэтому сейчас я пытаюсь его удалить.
Я успешно удалил ключи GPG и репозиторий Docker из apt, но при попытке удалить пакет Docker я получаю следующую ошибку:
~ 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)
Каким-то образом файл /var/run/docker-ssd.pid
идентифицировал идентификатор процесса, который либо не удалось запустить, либо был уничтожен без очистки файла.
Как бы то ни было, удаление этого файла позволило завершить очистку.
~ 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: docker
Интересное примечание: возможно, проблема, на самом деле, не в WSL. Похоже, что другие столкнулись с аналогичными проблемами и смогли их решить. См. Docker для Linux GitHub, выпуск № 52: Не удалось изменить пакет с помощью apt в подсистеме Linux для Windows