Skip to content

Commit 42bba52

Browse files
eshattowE Shattow
authored andcommitted
engine: install: debian.md suggest using apt UI
Suggest using apt for user-interactive commands: - Replace apt-get invocation - Replace apt-cache madison invocation - Filter unofficial package names for removal to installed packages
1 parent e9ad5f4 commit 42bba52

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

content/manuals/engine/install/debian.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ conflicts with the versions bundled with Docker Engine.
7171
Run the following command to uninstall all conflicting packages:
7272

7373
```console
74-
$ for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
74+
$ sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-doc podman-docker containerd runc | cut -f1)
7575
```
7676

77-
`apt-get` might report that you have none of these packages installed.
77+
`apt` might report that you have none of these packages installed.
7878

7979
Images, containers, volumes, and networks stored in `/var/lib/docker/` aren't
8080
automatically removed when you uninstall Docker. If you want to start with a
@@ -109,8 +109,8 @@ Docker from the repository.
109109

110110
```bash
111111
# Add Docker's official GPG key:
112-
sudo apt-get update
113-
sudo apt-get install ca-certificates curl
112+
sudo apt update
113+
sudo apt install ca-certificates curl
114114
sudo install -m 0755 -d /etc/apt/keyrings
115115
sudo curl -fsSL {{% param "download-url-base" %}}/gpg -o /etc/apt/keyrings/docker.asc
116116
sudo chmod a+r /etc/apt/keyrings/docker.asc
@@ -124,7 +124,7 @@ Docker from the repository.
124124
Signed-By: /etc/apt/keyrings/docker.asc
125125
EOF
126126
127-
sudo apt-get update
127+
sudo apt update
128128
```
129129
130130
> [!NOTE]
@@ -148,7 +148,7 @@ Docker from the repository.
148148
To install the latest version, run:
149149
150150
```console
151-
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
151+
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
152152
```
153153
154154
{{< /tab >}}
@@ -158,19 +158,18 @@ Docker from the repository.
158158
available versions in the repository:
159159
160160
```console
161-
# List the available versions:
162-
$ apt-cache madison docker-ce | awk '{ print $3 }'
161+
$ apt list --all-versions docker-ce
163162
164-
5:{{% param "docker_ce_version" %}}-1~debian.12~bookworm
165-
5:{{% param "docker_ce_version_prev" %}}-1~debian.12~bookworm
163+
docker-ce/bookworm 5:{{% param "docker_ce_version" %}}-1~debian.12~bookworm <arch>
164+
docker-ce/bookworm 5:{{% param "docker_ce_version_prev" %}}-1~debian.12~bookworm <arch>
166165
...
167166
```
168167
169168
Select the desired version and install:
170169
171170
```console
172171
$ VERSION_STRING=5:{{% param "docker_ce_version" %}}-1~debian.12~bookworm
173-
$ sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
172+
$ sudo apt install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
174173
```
175174
176175
{{< /tab >}}
@@ -284,7 +283,7 @@ To upgrade Docker Engine, download the newer package files and repeat the
284283
1. Uninstall the Docker Engine, CLI, containerd, and Docker Compose packages:
285284
286285
```console
287-
$ sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
286+
$ sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
288287
```
289288
290289
2. Images, containers, volumes, or custom configuration files on your host

0 commit comments

Comments
 (0)