Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker can't be uninstalled if it never worked (Ubuntu) #601

Closed
dbanck opened this issue May 13, 2013 · 3 comments
Closed

docker can't be uninstalled if it never worked (Ubuntu) #601

dbanck opened this issue May 13, 2013 · 3 comments

Comments

@dbanck
Copy link

dbanck commented May 13, 2013

Uninstallation will fail because the prerm script cannot stop the docker instance (because none is running):

root@hv ~ # aptitude purge lxc-docker
The following packages will be REMOVED:  
  lxc-docker{p} 
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 4,483 kB will be freed.
Do you want to continue? [Y/n/?] 
(Reading database ... 56846 files and directories currently installed.)
Removing lxc-docker ...
stop: Unknown instance: 
dpkg: error processing lxc-docker (--purge):
 subprocess installed pre-removal script returned error exit status 1
docker start/running, process 11949
Errors were encountered while processing:
 lxc-docker
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:

This script causes the problem /var/lib/dpkg/info/lxc-docker.prerm (docker/packaging/ubuntu/lxc-docker.prerm)

#!/bin/sh

# Stop docker
/sbin/stop docker

The script should only try to stop docker if an instance is running.

@ghost ghost assigned mzdaniel May 16, 2013
@mzdaniel
Copy link
Contributor

Thank you, Daniel!. Good catch. This has been done in the Debian package, I'll correct this.

@terrywang
Copy link

I had pretty much the same problem on Ubuntu 12.04.

Error

# apt-get purge lxc-docker 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  bsdtar
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  lxc-docker*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 4,753 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 235601 files and directories currently installed.)
Removing lxc-docker ...
stop: Unknown instance: 
dpkg: error processing lxc-docker (--purge):
 subprocess installed pre-removal script returned error exit status 1
docker start/running, process 1841
Errors were encountered while processing:
 lxc-docker
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB
localepurge: Disk space freed in /usr/share/gnome/help: 0 KiB
localepurge: Disk space freed in /usr/share/omf: 0 KiB

Total disk space freed by localepurge: 0 KiB

E: Sub-process /usr/bin/dpkg returned an error code (1)

To workaround it, I just did a dirty trick, commented out /sbin/stop docker in the pre-removal script /var/lib/dpkg/info/lxc-docker.prerm and it went through.

@mzdaniel
Copy link
Contributor

@dbanck, @terrywang could you verify the following patch works for you?

41cdd9b

mzdaniel added a commit that referenced this issue Jul 2, 2013
Packaging|ubuntu, issue #601: Allow packaging prerm to do its job
@mzdaniel mzdaniel closed this as completed Jul 2, 2013
dperny pushed a commit to dperny/docker that referenced this issue Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants