# Update the apt package index:
sudo apt-get update
# Install the package to allow apt to use the repository via HTTPS:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# Add Docker's official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# 9 DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 By searching the last 8 characters of the fingerprint, verify that you now have the key with the fingerprint
sudo apt-key fingerprint 0EBFCD88
Get the name of the Ubuntu distribution
lsb_release -cs
obtain
cosmic
View the system architecture of the machine
amd64
Execute the following command to set up the stable repository:
sudo add-apt-repository \
" deb [arch=amd64] https://download.docker.com/linux/ubuntu \
cosmic\
stable"
It is found that the stable version of 18.10 is temporarily not available, so I switch to 18.04:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
# Update the apt package index.
sudo apt-get update
# Install the latest version of Docker CE
sudo apt-get install docker-ce
Recommended Posts