报错信息
设置稳定版仓库
sudo add-apt-repository
“deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs)
stable”
错误:10 https://download.docker.com/linux/ubuntu (lsb_release Release
404 Not Found [IP: 13.227.76.110 443]
正在读取软件包列表… 完成
E: 仓库 “https://download.docker.com/linux/ubuntu (lsb_release Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
分析:
(lsb_release -cs):获取ubuntu版本号 20是focal,命令等同于
sudo add-apt-repository
“deb [arch=amd64] https://download.docker.com/linux/ubuntu
focal
stable”
可能是第一次命令没有输入正确,系统文件写入了错误的参数
解决办法:
sudo gedit /etc/apt/sources.list
清空错误命令写入的,重新执行
sudo add-apt-repository
“deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs)
stable”
正确写入的: