How to uninstall docker.io software in Ubuntu

Docker is a platform for developing, shipping, and running applications inside containers. It allows developers to package an application with all of its dependencies into a single unit called a container, which can then be easily moved between different environments, such as development, testing, and production.

Docker.io is the package that provides the Docker runtime and command-line tools on Ubuntu systems. It is available in the official Ubuntu repositories and can be installed using the “apt-get” package manager.

Once installed, Docker.io provides a set of command-line tools that allow you to manage containers, images, and networks. Some of the most commonly used Docker commands include:

  • docker run: Run a container from an image.
  • docker stop: Stop a running container.
  • docker ps: List all running containers.
  • docker images: List all available images.
  • docker build: Build an image from a Dockerfile.

Docker.io also provides a registry service called Docker Hub, where users can share and download container images. Additionally, Docker.io can be used with other tools such as Docker Compose and Docker Swarm to manage multi-container applications and container orchestration.

Uninstalling docker.io on Ubuntu

To uninstall the Docker.io software on Ubuntu, you can follow these steps:

1. Stop and remove any running Docker containers:

$ sudo docker stop $(sudo docker ps -a -q)
$ sudo docker rm $(sudo docker ps -a -q)

2. Remove the Docker.io package:

$ sudo apt-get remove docker.io

3. Remove the Docker configuration files:

$ sudo rm -rf /var/lib/docker
$ sudo rm /etc/apparmor.d/docker
$ sudo groupdel docker

The first command stops and removes any running Docker containers. The second command removes the Docker.io package from your system. The third command removes the Docker configuration files and the Docker AppArmor profile. Finally, the last command removes the “docker” group.

Note: that if you have installed Docker using the “docker-ce” package instead of the “docker.io” package, you should replace “docker.io” with “docker-ce” in the above commands.

Uninstall docker.io including dependent package

If you would like to remove docker.io and it’s dependent packages which are no longer needed, the use the below command:

$ sudo apt-get remove --auto-remove docker.io 

Use Purging docker.io

If you use with purge options to docker.io package all the configuration and dependent packages will be removed.

$ sudo apt-get purge docker.io 

If you use purge options along with auto remove, will be removed everything regarding the package, It’s really useful when you want to reinstall again.

$ sudo apt-get purge --auto-remove docker.io 
Related Post