Docker-ce suddenly broke - cannot reinstall, hangs in systemd service enable

Solution 1:

I am not sure what kernel version you are running, but I noted this exact problem today and noticed that running docker ps just hanged the computer and like you I couldn’t deinstall or reinstall without killing the processes and manually remove files (when trying to reinstall the progress bar even stopped at 94% - exactly as in your screenshot).

What I found was that on all servers this problem arose, they were running kernel 5.3.0-52-generic (from the linux-virtual-hwe-18.04 package).

After downgrading the kernel by installing the linux-virtual package with kernel 4.15.0.100.90 and rebooting with that kernel, the docker installation/uninstallation was successful.

I also tried installing kernel 5.6.7 from https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.6.7/ on the same server and reinstalling docker with success. So, my guess is that it is something related to the kernel. And my solution was just to install an older or newer kernel.