Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#8309] docs: replace deprecated apt-key in how-to-build.md (#12706)

Abdullah2ee1453fd8e2
diff --git a/docs/how-to-build.md b/docs/how-to-build.md
index a4221cef1a..e6bad80121 100644
--- a/docs/how-to-build.md
+++ b/docs/how-to-build.md
@@ -202,8 +202,12 @@ Updating the package list ensures you have the latest information on the newest
**On Ubuntu (WSL):**
```shell
-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 ca-certificates curl
+sudo install -m 0755 -d /etc/apt/keyrings
+sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
+sudo chmod a+r /etc/apt/keyrings/docker.asc
+echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install docker-ce
sudo service docker start
@@ -211,7 +215,7 @@ sudo docker run hello-world
sudo usermod -aG docker $USER
```
-These commands install Docker. Running `hello-world` verifies the installation. Adding your user to the Docker group allows you to run Docker commands without `sudo`.
+These commands install Docker using the signed `apt` keyring instead of the deprecated `apt-key` command. Running `hello-world` verifies the installation. Adding your user to the Docker group allows you to run Docker commands without `sudo`.
### Install Python 3.11