[Ubuntu 18.04 LTS] How to completely uninstall old Docker and current Docker

If you have an old version of Docker and want to update to Docker CE, use method ①.
If you want to reinstall Docker CE 19.03 that you have installed now, use method (XNUMX).

Older versions of Docker are Docker, Docker-engine, and Docker.io.
The current version is Docker-CE.

1. XNUMX.Uninstall an older version of Docker

Enter the following from the Ubuntu terminal

# docker docker-engine remove docker.io sudo apt-get remove docker docker-engine docker.io

2.Uninstall the current version (Docker CE)

You can permanently delete the image container as well as the CE. Autoremove also removes related packages.

# Remove Docker CE sudo apt-get purge docker-ce #Docker also remove images and containers sudo rm -rf / var / lib / docker # Use Docker to automatically install and remove unnecessary packages sudo apt autoremove

reference: