Step 1: Remove Docker Packages
Open a terminal and run the following command to list all installed Docker packages:
$ dpkg -l | grep -i docker
This will show you a list of Docker-related packages installed on your system. Thereafter you can use the following command to remove those packages:
$ sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli
Step 2: Remove Docker Images, Containers, and Volumes
You must comprehend that removing Docker packages doesn't remove your Docker images, containers, and volumes. Therefore if you want to completely remove Docker, including all its data, run the following commands:
Caution: This will delete all your Docker data, including containers, images, and volumes. Make sure you have backed up any necessary data.
$ sudo rm -rf /var/lib/docker
Step 3: Remove Docker Compose
If you have Docker Compose installed, you may want to remove it as well. Use the following command:
$ sudo rm /usr/local/bin/docker-compose
Step 4: Remove Docker Group
By default, Docker adds your user to the "docker" group. If you want to remove this group, run the following command:
$ sudo groupdel docker
Step 5: Verify Uninstallation
You can check if Docker has been completely removed by running the following command:
$ docker --version
If Docker has been successfully uninstalled, this command should return a "command not found" or No such file or directory message.
That's it! Docker should now be uninstalled from your Linux Mint system.
Top comments (0)