Skip to content

Commit c66ce52

Browse files
eshattowE Shattow
authored andcommitted
engine/install: refresh debian.md for compliance with Deb822
Deprecate sources.list and use .sources instead For context Deb822 format was introduced in apt version 1.1 ten years ago and with the recent releases there is now a modernize-sources subcommand to encourage migration into .sources format. sources.list(5) says of the Deb822 ".sources" format "It is intended to make this format gradually the default format, deprecating the previously described one-line-style format, as it is easier to create, extend and modify for humans and machines alike..." https://wiki.debian.org/DebianRepository/UseThirdParty Note for clarity /etc/apt/keyrings as the Docker install guide suggest is in fact the correct location for a keyring installed by the system operator, so the guide gets it half-right already. Also some minor cleanup of the installation workflow where appropriate, prefer sequoia over gpg, and prefer curl over wget, as appears in the above Wiki article. Contextual examples are updated with the latest stable release strings. Package name lists are sorted with `LANG=C sort`.
1 parent 764f213 commit c66ce52

File tree

1 file changed

+40
-37
lines changed

1 file changed

+40
-37
lines changed

content/manuals/engine/install/debian.md

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ before you install the official version of Docker Engine.
5858

5959
The unofficial packages to uninstall are:
6060

61-
- `docker.io`
6261
- `docker-compose`
6362
- `docker-doc`
63+
- `docker.io`
6464
- `podman-docker`
6565

6666
Moreover, Docker Engine depends on `containerd` and `runc`. Docker Engine
@@ -71,7 +71,12 @@ conflicts with the versions bundled with Docker Engine.
7171
Run the following command to uninstall all conflicting packages:
7272

7373
```console
74-
sudo apt remove docker.io docker-doc docker-compose podman-docker containerd runc
74+
sudo apt remove containerd \
75+
docker-compose \
76+
docker-doc \
77+
docker.io \
78+
podman-docker \
79+
runc
7580
```
7681

7782
`apt` might report that you have none of these packages installed.
@@ -89,8 +94,8 @@ You can install Docker Engine in different ways, depending on your needs:
8994
[Docker Desktop for Linux](/manuals/desktop/setup/install/linux/_index.md). This is
9095
the easiest and quickest way to get started.
9196

92-
- Set up and install Docker Engine from
93-
[Docker's `apt` repository](#install-using-the-repository).
97+
- Set up and install Docker Engine from the
98+
[Docker `apt` repository](#install-using-the-repository).
9499

95100
- [Install it manually](#install-from-a-package) and manage upgrades manually.
96101

@@ -99,44 +104,36 @@ You can install Docker Engine in different ways, depending on your needs:
99104

100105
{{% include "engine-license.md" %}}
101106

102-
### Install using the `apt` repository {#install-using-the-repository}
107+
### Install using the Docker `apt` repository {#install-using-the-repository}
103108

104109
Before you install Docker Engine for the first time on a new host machine, you
105110
need to set up the Docker `apt` repository. Afterward, you can install and update
106111
Docker from the repository.
107112

108-
1. Set up Docker's `apt` repository.
113+
1. Set up the Docker `apt` repository.
109114

110115
```bash
111-
# Add Docker's official GPG key:
112-
sudo apt update
113-
sudo apt install ca-certificates curl
114-
sudo install -m 0755 -d /etc/apt/keyrings
115-
sudo curl -fsSL {{% param "download-url-base" %}}/gpg -o /etc/apt/keyrings/docker.asc
116-
sudo chmod a+r /etc/apt/keyrings/docker.asc
116+
sudo apt install curl ca-certificates sq
117+
118+
curl {{% param "download-url-base" %}}/gpg | \
119+
sudo sq packet dearmor --output /etc/apt/keyrings/docker.gpg
117120

118-
# Add the repository to Apt sources:
119-
echo \
120-
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] {{% param "download-url-base" %}} \
121-
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
122-
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
121+
sudo tee /etc/apt/sources.list.d/docker.sources << EOF
122+
Types: deb
123+
URIs: {{% param "download-url-base" }}
124+
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
125+
Components: stable
126+
Signed-By: /etc/apt/keyrings/docker.gpg
127+
EOF
123128
124129
sudo apt update
125130
126131
```
127132
128133
> [!NOTE]
129134
>
130-
> If you use a derivative distribution, such as Kali Linux,
131-
> you may need to substitute the part of this command that's expected to
132-
> print the version codename:
133-
>
134-
> ```console
135-
> $(. /etc/os-release && echo "$VERSION_CODENAME")
136-
> ```
137-
>
138-
> Replace this part with the codename of the corresponding Debian release,
139-
> such as `bookworm`.
135+
> If you use a derivative distribution you may need to change `Suites:` to
136+
> the corresponding suite name from [`{{% param "download-url-base" %}}/dists/`]({{% param "download-url-base" %}}/dists/).
140137
141138
2. Install the Docker packages.
142139
@@ -146,7 +143,11 @@ Docker from the repository.
146143
To install the latest version, run:
147144
148145
```console
149-
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
146+
sudo apt install containerd.io \
147+
docker-buildx-plugin \
148+
docker-ce \
149+
docker-ce-cli \
150+
docker-compose-plugin
150151
```
151152
152153
{{< /tab >}}
@@ -158,16 +159,19 @@ Docker from the repository.
158159
```console
159160
apt list --all-versions docker-ce
160161
161-
docker-ce/bookworm 5:{{% param "docker_ce_version" %}}-1~debian.13~bookworm <arch>
162-
docker-ce/bookworm 5:{{% param "docker_ce_version_prev" %}}-1~debian.13~bookworm <arch>
162+
docker-ce/trixie 5:{{% param "docker_ce_version" %}}-1~debian.13~trixie <arch>
163+
docker-ce/trixie 5:{{% param "docker_ce_version_prev" %}}-1~debian.13~trixie <arch>
163164
...
164165
```
165166
166167
Select the desired version and install:
167168
168169
```console
169-
VERSION_STRING=5:{{% param "docker_ce_version" %}}-1~debian.12~bookworm
170-
sudo apt install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
170+
sudo apt install containerd.io \
171+
docker-buildx-plugin \
172+
docker-ce=5:{{% param "docker_ce_version" %}}-1~debian.13~trixie \
173+
docker-ce-cli=5:{{% param "docker_ce_version" %}}-1~debian.13~trixie \
174+
docker-compose-plugin
171175
```
172176
173177
{{< /tab >}}
@@ -209,9 +213,8 @@ choosing the new version you want to install.
209213
210214
### Install from a package
211215
212-
If you can't use Docker's `apt` repository to install Docker Engine, you can
213-
download the `deb` file for your release and install it manually. You need to
214-
download a new file each time you want to upgrade Docker Engine.
216+
You may download the `deb` file for your release and install it manually. You
217+
would need to download a new file each time you want to upgrade Docker Engine.
215218
216219
<!-- markdownlint-disable-next-line -->
217220
1. Go to [`{{% param "download-url-base" %}}/dists/`]({{% param "download-url-base" %}}/dists/).
@@ -295,8 +298,8 @@ To upgrade Docker Engine, download the newer package files and repeat the
295298
3. Remove source list and keyrings
296299
297300
```console
298-
sudo rm /etc/apt/sources.list.d/docker.list
299-
sudo rm /etc/apt/keyrings/docker.asc
301+
sudo rm /etc/apt/sources.list.d/docker.sources
302+
sudo rm /etc/apt/keyrings/docker.gpg
300303
```
301304
302305
You have to delete any edited configuration files manually.

0 commit comments

Comments
 (0)