原文網(wǎng)址:Ubuntu之a(chǎn)pt-get--解決安裝docker的報錯:Package docker-ce is not available, but is referred to by another p_IT利刃出鞘的博客-CSDN博客
簡介
本文介紹用Ubuntu的apt-get命令安裝docker時提示docker-ce不可用的解決方法。
錯誤日志
Package docker-ce is not available, but is referred to by another package
原因
此版本的源中沒有docker-ce的安裝包,所以報錯。解決辦法:使用舊版本的docker倉庫(本處用的是bionic)。
法1:命令添加更新源
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
然后執(zhí)行:
sudo apt-get update
備注:
移除某個源的方法是:
sudo add-apt-repository -r "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
法2:配置文件添加更新源
?/etc/apt/sources.list.d/docker.list 中添加下面內(nèi)容(此文件若不存在則新建)
deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable
命令如下:文章來源:http://www.zghlxwxcb.cn/news/detail-782459.html
cd /etc/apt/sources.list.d;
sudo touch docker.list;
sudo chmod 666 docker.list;
sudo echo "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" > docker.list;
然后執(zhí)行:文章來源地址http://www.zghlxwxcb.cn/news/detail-782459.html
sudo apt-get update
到了這里,關于Ubuntu之a(chǎn)pt-get--解決安裝docker的報錯:Package docker-ce is not available, but is referred to by another p的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!