在执行sudo apt-get updat命令时遇到错误:

命中:1 http://cn.archive.ubuntu.com/ubuntu bionic InRelease                   
忽略:2 https://mirrors.aliyun.com/docker-ce/linux/ubuntu (lsb_release InRelease
错误:3 https://mirrors.aliyun.com/docker-ce/linux/ubuntu (lsb_release Release
404 Not Found [IP: 180.97.148.113 443]
正在读取软件包列表... 完成
E: 仓库 “https://mirrors.aliyun.com/docker-ce/linux/ubuntu (lsb_release Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

我用的Mint 上这里查询自己电脑的​​Package Base​​:

​https://www.linuxmint.com/download_all.php​

Mint | Ubuntu20安装docker 仓库没有 Release 文件_ubuntu

查询出来应该是focal,所以在配置源的时候,需要手动修改

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

其中​​$(lsb_release -cs)​​​是变量,在回车后自动执行,在bash中查询得到的内容为​​uma​​​,也就是​​CODENAME​​,但是这个在源网址里面不一定有。所以把这里手动替换就可以。

sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
foacl \
stable"

然后再

sudo apt-get update

即可。