Skip to content

Commit 910bca2

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 8ceeb47 commit 910bca2

File tree

1 file changed

+41
-37
lines changed

1 file changed

+41
-37
lines changed

content/manuals/engine/install/debian.md

Lines changed: 41 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-
$ for pkg in docker.io docker-doc docker-compose podman-docker containerd runc
74+
$ for pkg in containerd \
75+
docker-compose \
76+
docker-doc \
77+
docker.io \
78+
podman-docker \
79+
runc
7580
do sudo apt remove $pkg
7681
done
7782
```
@@ -91,8 +96,8 @@ You can install Docker Engine in different ways, depending on your needs:
9196
[Docker Desktop for Linux](/manuals/desktop/setup/install/linux/_index.md). This is
9297
the easiest and quickest way to get started.
9398

94-
- Set up and install Docker Engine from
95-
[Docker's `apt` repository](#install-using-the-repository).
99+
- Set up and install Docker Engine from the
100+
[Docker `apt` repository](#install-using-the-repository).
96101

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

@@ -101,43 +106,36 @@ You can install Docker Engine in different ways, depending on your needs:
101106

102107
{{% include "engine-license.md" %}}
103108

104-
### Install using the `apt` repository {#install-using-the-repository}
109+
### Install using the Docker `apt` repository {#install-using-the-repository}
105110

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

110-
1. Set up Docker's `apt` repository.
115+
1. Set up the Docker `apt` repository.
111116

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

120-
# Add the repository to Apt sources:
121-
$ echo \
122-
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] {{% param "download-url-base" %}} \
123-
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
124-
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
123+
$ sudo tee /etc/apt/sources.list.d/docker.sources << EOF
124+
Types: deb
125+
URIs: {{% param "download-url-base" %}}
126+
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
127+
Components: stable
128+
Signed-By: /etc/apt/keyrings/docker.gpg
129+
EOF
125130

126131
$ sudo apt update
127132
```
128133

129134
> [!NOTE]
130135
>
131-
> If you use a derivative distribution, such as Kali Linux,
132-
> you may need to substitute the part of this command that's expected to
133-
> print the version codename:
134-
>
135-
> ```console
136-
> $(. /etc/os-release && echo "$VERSION_CODENAME")
137-
> ```
138-
>
139-
> Replace this part with the codename of the corresponding Debian release,
140-
> such as `bookworm`.
136+
> If you use a derivative distribution then you may need to change
137+
> `Suites:` to the corresponding suite name from
138+
> [`{{% param "download-url-base" %}}/dists/`]({{% param "download-url-base" %}}/dists/).
141139
142140
2. Install the Docker packages.
143141

@@ -147,7 +145,11 @@ Docker from the repository.
147145
To install the latest version, run:
148146

149147
```console
150-
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
148+
$ sudo apt install containerd.io \
149+
docker-buildx-plugin \
150+
docker-ce \
151+
docker-ce-cli \
152+
docker-compose-plugin
151153
```
152154

153155
{{< /tab >}}
@@ -159,16 +161,19 @@ Docker from the repository.
159161
```console
160162
$ apt list --all-versions docker-ce
161163

162-
docker-ce/bookworm 5:{{% param "docker_ce_version" %}}-1~debian.12~bookworm <arch>
163-
docker-ce/bookworm 5:{{% param "docker_ce_version_prev" %}}-1~debian.12~bookworm <arch>
164+
docker-ce/trixie 5:{{% param "docker_ce_version" %}}-1~debian.13~trixie <arch>
165+
docker-ce/trixie 5:{{% param "docker_ce_version_prev" %}}-1~debian.13~trixie <arch>
164166
...
165167
```
166168

167169
Select the desired version and install:
168170

169171
```console
170-
$ VERSION_STRING=5:{{% param "docker_ce_version" %}}-1~debian.12~bookworm
171-
$ sudo apt install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
172+
$ sudo apt install containerd.io \
173+
docker-buildx-plugin \
174+
docker-ce=5:{{% param "docker_ce_version" %}}-1~debian.13~trixie \
175+
docker-ce-cli=5:{{% param "docker_ce_version" %}}-1~debian.13~trixie \
176+
docker-compose-plugin
172177
```
173178

174179
{{< /tab >}}
@@ -210,9 +215,8 @@ choosing the new version you want to install.
210215

211216
### Install from a package
212217

213-
If you can't use Docker's `apt` repository to install Docker Engine, you can
214-
download the `deb` file for your release and install it manually. You need to
215-
download a new file each time you want to upgrade Docker Engine.
218+
You may download the `deb` file for your release and install it manually. You
219+
would need to download a new file each time you want to upgrade Docker Engine.
216220

217221
<!-- markdownlint-disable-next-line -->
218222
1. Go to [`{{% param "download-url-base" %}}/dists/`]({{% param "download-url-base" %}}/dists/).
@@ -296,8 +300,8 @@ To upgrade Docker Engine, download the newer package files and repeat the
296300
3. Remove source list and keyrings
297301

298302
```console
299-
$ sudo rm /etc/apt/sources.list.d/docker.list
300-
$ sudo rm /etc/apt/keyrings/docker.asc
303+
$ sudo rm /etc/apt/sources.list.d/docker.sources
304+
$ sudo rm /etc/apt/keyrings/docker.gpg
301305
```
302306

303307
You have to delete any edited configuration files manually.

0 commit comments

Comments
 (0)