Uninstall Docker

Akhila
1 min readNov 30, 2020

Steps to uninstall docker

**********************

Hi everyone, i would like to share one of the problems i faced while uninstalling docker in my machine(Ubuntu).

While uninstalling docker, i followed some commands specified in the original document.

$ sudo apt-get remove docker docker-engine docker.io containerd runc

but it took me around 5–6 hrs, but nothing happed, so as it is a time taking process, i mannualy deleted docker by following steps

  1. /var/lib/ remove all the docker files in this path.
  2. /usr/bin/ remove all the docker files in the path.
  3. Use ps -ef | grep docker to see if any process is in progress.
  4. If any process is in progress, then kill the process using PID(soft kill is recommended) sudo kill -2 <pid>
  5. Use $ sudo apt-get remove docker docker-engine docker.io containerd runc

Use step 5 to make sure everything is removed.

Then install the docker mentioned in the original document with different ways, in my case i used the below commands to install docker without any error.

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Docker installed successfully.

You can remove all the containers, volumes using docker system prune.

Hope this piece of code is helpful, Thank you.

--

--