A Complete Guide to Uninstalling Docker completely on Pop!_OS and Ubuntu-based Systems

I'm a passionate software developer.
Search for a command to run...

I'm a passionate software developer.
No comments yet. Be the first to comment.
Components Introduction In order to truly understand props in React, we first need to be clear on what components are. A component is a reusable piece of the user interface that encapsulates structure, styling, and behavior. Instead of repeating the ...

Introduction Context By default, Codespace is using the GITHUB_TOKEN env var (the “Codespaces token”), which can’t create repos. It’s necessary to authenticate gh with a token/account that has the right scopes, or create the repo on the web first. Ob...

Solution Here it is: git commit --allow-empty-message -m "" Explanation To create a Git commit without a message, or with an empty message, you can use the --allow-empty-message flag with the git commit command. git commit --allow-empty-message -m "...

Steps Cleanup phase This phase’s goal is to removes existing containers, volumes, networks and images Stop and remove volumes docker compose down --volumes --remove-orphans The previous command stops and removes containers, networks, and default volu...

It’s not mandatory, but before uninstalling, it's a good practice to stop any running Docker services.
sudo systemctl stop docker
It’s used to completely and forcefully remove a list of specified packages from a Debian-based Linux system like Pop!_OS. All the following packages are docker related.
In short, this command aims to leave no trace of the specified Docker packages, which is an essential step for a complete and thorough uninstallation.
sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli containerd runc
and also
sudo apt-get purge -y docker-compose-plugin
In summary, the command is a non-interactive, forced, and recursive deletion of all major Docker-related data and configuration directories. This is an essential step for a complete uninstallation.
sudo rm -rf /var/lib/docker/ /var/lib/containerd/ /etc/docker ~/.docker/
When you install Docker, it creates a docker group. This group is created for security and convenience, allowing users to run Docker commands without needing sudo every time.
In this case, since we don’t need it anymore, we’re going to delete the docker group.
sudo groupdel docker
By deleting this file, you are essentially telling your system to stop looking for Docker updates from the official Docker repository. This is an important step in a complete uninstallation, as it ensures that apt-get update no longer tries to connect to a repository for a program that you no longer want on your system.
sudo rm /etc/apt/sources.list.d/docker.list
In summary, the goal is to remove old, useless downloaded package files to free up disk space, but it does not remove any installed software.
It is a maintenance command that is good to run periodically after uninstalling software or upgrading your system.
sudo apt-get autoremove -y --purge docker-ce docker-ce-cli
sudo apt-get autoclean
docker --version
docker compose --version
docker
Output
