Home Operation and Maintenance Docker How to completely uninstall docker

How to completely uninstall docker

Apr 18, 2023 pm 03:22 PM

With the rapid development of cloud computing and container technology, Docker has become one of the most popular containerized application platforms today. However, for some users, they may encounter some problems, such as being unable to start Docker containers, unable to update Docker, etc. These issues may be related to Docker not being removed properly. This article will show you how to completely uninstall Docker to resolve these issues.

Step 1: Stop Docker

Before uninstalling Docker, you first need to stop Docker.

On the terminal, enter the following command to stop the running Docker service:

$ sudo systemctl stop docker
Copy after login

Step 2: Remove the Docker package

Docker contains many software packages. Therefore, you need to delete them all.

On the terminal, enter the following command to delete the Docker package:

$ sudo apt-get purge docker-ce
Copy after login

This command will delete the Docker package and dependencies.

Step 3: Delete the Docker directory and files

After deleting the Docker package in the previous step, you need to manually delete the Docker directory and files.

On the terminal, enter the following command to delete the Docker directory and files:

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

The first command will delete the /var/lib/docker directory, which is the container image generated during Docker running. The location of files such as containers.

The second command will delete the /etc/docker directory, which is the location of Docker's configuration file.

The third command will delete the AppArmor policy.

The last command will delete the Docker user group.

Step Four: Delete Docker Repository

This is the final step so that Docker will be completely removed from your system.

On the terminal, enter the following command to delete the Docker repository:

$ sudo apt-get remove docker-ce-cli
$ sudo apt-get autoremove -y
Copy after login

The first command will delete the Docker CE CLI from the repository.

The second command will automatically remove dependencies.

Now you have successfully removed Docker from your system.

You can use the following command to verify whether the uninstallation was successful.

$ docker --version
Copy after login

If the output is similar to "docker command not found", it means it has been successfully deleted.

Conclusion:

The above are the steps to completely uninstall Docker. When a problem occurs, it is recommended to perform these steps first, completely delete Docker and reinstall it to ensure the correctness and stability of Docker.

The above is the detailed content of How to completely uninstall docker. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do I deploy applications to a Docker Swarm cluster? How do I deploy applications to a Docker Swarm cluster? Mar 17, 2025 pm 04:20 PM

The article details deploying applications to Docker Swarm, covering preparation, deployment steps, and security measures during the process.

What are Kubernetes pods, deployments, and services? What are Kubernetes pods, deployments, and services? Mar 17, 2025 pm 04:25 PM

The article explains Kubernetes' pods, deployments, and services, detailing their roles in managing containerized applications. It discusses how these components enhance scalability, stability, and communication within applications.(159 characters)

How do I scale applications in Kubernetes? How do I scale applications in Kubernetes? Mar 17, 2025 pm 04:28 PM

The article discusses scaling applications in Kubernetes using manual scaling, HPA, VPA, and Cluster Autoscaler, and provides best practices and tools for monitoring and automating scaling.

How do I implement rolling updates in Docker Swarm? How do I implement rolling updates in Docker Swarm? Mar 17, 2025 pm 04:23 PM

The article discusses implementing rolling updates in Docker Swarm to update services without downtime. It covers updating services, setting update parameters, monitoring progress, and ensuring smooth updates.

How do I manage services in Docker Swarm? How do I manage services in Docker Swarm? Mar 17, 2025 pm 04:22 PM

Article discusses managing services in Docker Swarm, focusing on creation, scaling, monitoring, and updating without downtime.

How do I manage deployments in Kubernetes? How do I manage deployments in Kubernetes? Mar 17, 2025 pm 04:27 PM

The article discusses managing Kubernetes deployments, focusing on creation, updates, scaling, monitoring, and automation using various tools and best practices.

How do I create a Docker Swarm cluster? How do I create a Docker Swarm cluster? Mar 17, 2025 pm 04:19 PM

Article discusses creating and managing Docker Swarm clusters, including setup, scaling services, and security best practices.

How does Docker Swarm differ from Kubernetes? How does Docker Swarm differ from Kubernetes? Mar 17, 2025 pm 04:18 PM

The article compares Docker Swarm and Kubernetes, focusing on their differences in architecture, ease of use, and ecosystem. Kubernetes is favored for large-scale deployments due to its scalability and advanced features, while Docker Swarm suits smal

See all articles