Complete the command to update the package list before installing Docker.
sudo apt-get [1]The apt-get update command refreshes the package list so you get the latest versions.
Complete the command to install Docker Engine on Ubuntu.
sudo apt-get install -y [1]The package docker-ce is the Docker Community Edition engine.
Fix the error in the command to add Dockerβs official GPG key.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo [1] --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgThe gpg --dearmor command converts the key to a format apt can use.
Fill both blanks to add the Docker repository to apt sources.
echo "deb [arch=[1] signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu [2] stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
The architecture is amd64 for most PCs, and focal is the Ubuntu 20.04 codename.
Fill all three blanks to verify Docker installation by running the hello-world container.
sudo docker [1] hello-world && sudo docker [2] && sudo docker [3]
docker run hello-world runs a test container, docker ps lists running containers, and docker version shows Docker version info.