Ubuntu 安装 Docker

Docker Ubuntu About 1,083 words

镜像源

https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/

卸载

卸载原先安装过的docker

sudo apt-get remove docker docker-engine docker.io

安装依赖

sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

异常信息

如果有报错,提示gnupg2没安装,可以更换镜像源为清华大学Ubuntu镜像源。

具体可参考:

Package gnupg2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  gpgv gpgsm gnupg-l10n gnupg dirmngr

E: Package 'gnupg2' has no installation candidate

信任公钥

信任DockerGPG公钥。

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

添加仓库

amd64

sudo add-apt-repository \
   "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

树莓派或其它 ARM

echo "deb [arch=armhf] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
     $(lsb_release -cs) stable" | \
    sudo tee /etc/apt/sources.list.d/docker.list

安装 Docker

sudo apt-get update
sudo apt-get install docker-ce
Views: 2,061 · Posted: 2022-01-15

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh