I came here after discovering that sudo docker ps
would hang forever on my fresh raspberry pi 4
with a ubuntu 20.04.
Putting the value of $HOSTNAME
behind 127.0.0.1
in /etc/hosts
seemed to have made sudo "more accessible".
But still docker would not run properly. apt upgrade
failed for docker also, I couldn't even kill the process with ctrl + c
, but had to pkill apt
and then kill the process of dpkg
by its PID
.
Doing sudo dpkg --configure -a
as suggested by another ´apt upgrade´, hung at docker-ce package again.
BUT during the first ´apt upgrade´ a new kernel had been installed. So I tried my luck with rebooting. Now it works again. Someone else had a similar experience here: https://askubuntu.com/questions/1236208/docker-ps-stuck-docker-install-also-just-hangs
sudo
after you’re already root? Does it still hang then? If so, you might try runningstrace
(or some similar program) on it.strace sudo -i
or so might be your friend, even if its output is daunting, because you can see what it's trying to do when it hangs.)