for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
Images, containers, volumes, and networks stored in /var/lib/docker/
aren't automatically removed when you uninstall Docker. If you want to start with a clean installation,To delete all images, containers, and volumes:
- sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
- sudo rm -rf /var/lib/docker
- sudo rm -rf /var/lib/containerd
Go to pool/stable/
and select the applicable architecture (amd64
, armhf
, arm64
, or s390x
).
Download the following deb
files for the Docker Engine, CLI, containerd, and Docker Compose packages:
containerd.io__.deb
docker-ce__.deb
docker-ce-cli__.deb
docker-buildx-plugin__.deb
docker-compose-plugin__.deb
- sudo dpkg -i ./containerd.io_<version>_<arch>.deb \
- ./docker-ce_<version>_<arch>.deb \
- ./docker-ce-cli_<version>_<arch>.deb \
- ./docker-buildx-plugin_<version>_<arch>.deb \
- ./docker-compose-plugin_<version>_<arch>.deb
- sudo apt update
- sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt update
- sudo apt install docker-ce -y
- sudo systemctl enable docker
参考链接