Showing posts with label docker. Show all posts
Showing posts with label docker. Show all posts

November 18, 2017

dpkg: error processing package docker.io (--purge)

docker icon
Uninstall (remove, purge) failed in Ubuntu 16.04 :
$ sudo aptitude purge docker docker.io
The following packages will be REMOVED:
  docker.io{p}
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Do you want to continue? [Y/n/?]
(Reading database ... 386398 files and directories currently installed.)
Removing docker.io (1.13.1-0ubuntu1~17.04.1) ...
Purging configuration files for docker.io (1.13.1-0ubuntu1~17.04.1) ...

Nuking /var/lib/docker ...
  (if this is wrong, press Ctrl+C NOW!)

+ sleep 10

/var/lib/docker/nuke-graph-directory.sh: 64: /var/lib/docker/nuke-graph-directory.sh: shopt: not found
dpkg: error processing package docker.io (--purge):
 subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
 docker.io
E: Sub-process /usr/bin/dpkg returned an error code (1)
It gives a hint: /var/lib/docker, so:
$ # This will erase all your container images
$ sudo rm -rf /var/lib/docker
$ sudo aptitude purge docker.io
The following packages will be REMOVED:
  docker.io{p}
0 packages upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
Do you want to continue? [Y/n/?]
(Reading database ... 386398 files and directories currently installed.)
Removing docker.io (1.13.1-0ubuntu1~17.04.1) ...
Purging configuration files for docker.io (1.13.1-0ubuntu1~17.04.1) ...
dpkg: warning: while removing docker.io, directory '/etc/docker' not empty so not removed
It gave another hint: '/etc/docker' not empty so not removed , so:
$ # This will erase all docker configs
$ sudo rm -rf /etc/docker/
$ sudo aptitude purge docker.io
Package docker.io is not installed, so it will not be purged
Package docker.io is not installed, so it will not be purged
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

Now if you need official and latest docker-ce (community edition) and docker-compose, see here:
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
https://docs.docker.com/compose/install/

~~~
Written with StackEdit.

March 28, 2017

install docker in debian jessie without unnecessary cgroupsfs-mount, mountall, and plymouth dependencies

docker

Install docker on your debian jessie workstation without unnecessary cgroupsfs-mount, mountall, and plymouth recommended dependencies.

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783143

Prerequisite: jessie-backports. Configure jessie-backports or the riskier unstable “sid” repositories before proceeding.

sudo aptitude install aufs-tools libnih-dbus1 libnih1 makedev git
sudo aptitude install -t jessie-backports --without-recommends docker.io

This should work, but be aware aptitude show docker.io shows these are required also:

Depends: adduser, iptables, init-system-helpers (>= 1.18~), perl, libapparmor1 (>= 2.6~devel),
 libc6 (>= 2.14), libdevmapper1.02.1 (>= 2:1.02.90), libsqlite3-0 (>= 3.5.9)

Now add your user account to the docker group; otherwise you will receive the error “permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?”

sudo gpasswd -a $USER docker ( same as sudo usermod -a -G docker $USER)

Logout and re-login. Potentially, you could also exec su -l $USER

Now start docker and set it enabled by default.

sudo systemctl enable docker
sudo systemctl start docker

Now install your preferred containers

docker pull vmware/powerclicore

~ ~ ~
  

Docker : "permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?"

docker

Docker : “permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?”, when docker pull

solution: add username to group docker, logout and relogin ; make certain the service is running

sudo groupadd docker
sudo gpasswd -a $USER docker (same as sudo usermod -a -G docker $USER)

Logout and re-login. Potentially, you could also exec su -l $USER

sudo cystemctl start docker
sudo cystemctl enable docker #if you want it enabled by default

~ ~ ~