I have installed docker as described here raspberrypi.org/blog/docker-comes-to-raspberry-pi with curl -sSL https://get.docker.com | sh. How do I uninstall it?

  • 2
    For posterity, this is the wrong way to install now that docker is in the Raspbian repos.
    – goldilocks
    Commented Mar 11, 2018 at 19:39
  • 3
    That doesn't help now does it...
    – förschter
    Commented Mar 12, 2018 at 7:05

4 Answers 4


I had to use sudo apt remove docker-ce. The script at get.docker.com runs "$pkg_manager install -y -q docker-ce$pkg_version" so docker-ce is the package, not docker.

  • 8
    "docker -v" still worked. I did "sudo apt autoremove" to get rid of it entirely.
    – andy
    Commented Dec 3, 2018 at 10:44
  • 2
    You also want to uninstall docker-ce-cli. Commented Jan 25, 2022 at 21:58

Uninstall it by using

apt remove docker -y

Hope that helps.

  • Worth noting that the script sourced by curl | sh appears to use apt-get, which is why apt remove is appropriate.
    – goldilocks
    Commented Mar 11, 2018 at 19:33
  • Does that work when docker was not installed with apt?
    – förschter
    Commented Mar 11, 2018 at 19:34
  • 1
    It does not: "Package 'docker' is not installed, so not removed"
    – förschter
    Commented Mar 11, 2018 at 19:34
  • Well, it very well could have, if you go look at it. What it does if it didn't will be harder to figure out. You might check dpkg -l | grep docker to see if it used a package with a more convoluted name.
    – goldilocks
    Commented Mar 11, 2018 at 19:37
  • After that I did sudo dpkg --purge docker-ce Commented Jan 20, 2019 at 22:14

To remove the package: sudo apt remove docker-ce*

To remove the docker0 network interface: sudo ip link delete docker0

  • Thanks. This also removed docker-ce-cli to on my pi 3.
    – Sun Bee
    Commented Mar 6, 2021 at 19:04

Additional: Remove any USB Ethernet entries that you might have put at the bottom of the /etc/dhcpcd.conf

why? I upgraded to buster stable and my RPi3B+ seemed like it was fire-walled. Above fixes ethernet ghosted connections, WIFI was working. I say ghosted because the Plymouth desktop showed a live connected eth0 and Ip address, for example, but couldn't ping anything local to remote and vice versa. If I locally clicked on the WiCD icon the network would come alive. But not on a reboot.

The residue of Docker USB-net connections to the swarm, in the dhcpd, was stopping me using the ethernet.

  • Also, when doing apt-update, docker.com was still in the sources.list . To remove the entry $ sudo rm /etc/apt/sources.list.d/docker.list
    – Half-Tone
    Commented Jan 28, 2020 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.