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
- /var/lib/ remove all the docker files in this path.
- /usr/bin/ remove all the docker files in the path.
- Use ps -ef | grep docker to see if any process is in progress.
- If any process is in progress, then kill the process using PID(soft kill is recommended) sudo kill -2 <pid>
- 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.