将 /usrLib/apt/methods 中的 https 目录符号链接到 http 似乎可行:
$ cd /usr/lib/apt/methods
$ ln -s http https
确保在 apt-get install apt-transport-https 之后没有配置任何带有 https:// 的源,它实际上会用正确的文件覆盖符号链接。
之后运行 docker 安装脚本:
# remove old packages
$ sudo apt-get remove docker docker-engine docker.io containerd runc
# update
$ sudo apt-get update
# install dependencies
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
# fetch rep
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# add stable repo
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# update
$ sudo apt-get update
# install
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
这应该有效(来自官方文档)