Public bug reported:

If I install docker.io on xenial, remove it, upgrade to bionic, and
install it again, then the docker service doesn’t start.

This is because the xenial docker.io postrm left docker.service and
docker.socket masked (via an autogenerated deb-systemd-helper snippet),
and the bionic docker.io postinst only unmasks docker.socket.

Reproducible test case with LXD:

• Create a xenial container:

$ lxc remote add --protocol simplestreams ubuntu-minimal 
https://cloud-images.ubuntu.com/minimal/releases
$ lxc launch ubuntu-minimal:16.04 docker-test
$ lxc exec docker-test bash
root@docker-test:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.6 LTS
Release:        16.04
Codename:       xenial

• Install docker.io:

root@docker-test:~# apt update
root@docker-test:~# apt -y install docker.io
root@docker-test:~# systemctl list-unit-files docker.socket docker.service
UNIT FILE      STATE  
docker.service enabled
docker.socket  enabled

2 unit files listed.
root@docker-test:~# docker version -f '{{.Server.Version}}'
18.09.7

• Remove docker.io:

root@docker-test:~# apt -y remove docker.io
root@docker-test:~# systemctl list-unit-files docker.socket docker.service
UNIT FILE      STATE 
docker.service masked
docker.socket  masked

2 unit files listed.

• Upgrade to bionic:

root@docker-test:~# script /dev/null -c do-release-upgrade
…
Restart required 

To finish the upgrade, a restart is required. 
If you select 'y' the system will be restarted. 

Continue [yN] y
Script done, file is /dev/null
$ lxc exec docker-test bash
root@docker-test:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic

• Install docker.io:

root@docker-test:~# apt -y install docker.io
root@docker-test:~# systemctl list-unit-files docker.socket docker.service
UNIT FILE      STATE  
docker.service masked 
docker.socket  enabled

2 unit files listed.
root@docker-test:~# docker version -f '{{.Server.Version}}'

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the 
docker daemon running?
root@docker-test:~# systemctl start docker
Failed to start docker.service: Unit docker.service is masked.

• Workaround:

root@docker-test:~# systemctl unmask docker
Removed /etc/systemd/system/docker.service.
root@docker-test:~# systemctl start docker
root@docker-test:~# docker version -f '{{.Server.Version}}'
18.09.7

** Affects: docker.io (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1844894

Title:
  docker doesn’t start in bionic (Unit docker.service is masked), if
  previously installed+removed in xenial

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/docker.io/+bug/1844894/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to