帮酷LOGO
0 0 评论
文章标签:CAN  APT  candidate  

问题

我按官方Docker安装指南安装docker-ce。

当我执行 sudo apt install docker-ce 我得到了E: Package 'docker-ce' has no installation candidate


$ sudo apt-get update


Hit:1 http://gb.archive.ubuntu.com/ubuntu bionic InRelease


Hit:2 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease


Hit:3 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease


Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease


Reading package lists... Done



$ sudo apt-get install 


> apt-transport-https 


> ca-certificates 


> curl 


> software-properties-common


Reading package lists... Done


Building dependency tree 


Reading state information... Done


ca-certificates is already the newest version (20180409).


curl is already the newest version (7.58.0-2ubuntu3).


software-properties-common is already the newest version (0.96.24.32.1).


The following NEW packages will be installed


 apt-transport-https


0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.


Need to get 1,692 B of archives.


After this operation, 152 kB of additional disk space will be used.


Do you want to continue? [Y/n] 


Get:1 http://gb.archive.ubuntu.com/ubuntu bionic/universe amd64 apt-transport-https all 1.6.1 [1,692 B]


Fetched 1,692 B in 0s (65.4 kB/s) 


Selecting previously unselected package apt-transport-https.


(Reading database ... 116694 files and directories currently installed.)


Preparing to unpack .../apt-transport-https_1.6.1_all.deb ...


Unpacking apt-transport-https (1.6.1) ...


Setting up apt-transport-https (1.6.1) ...



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


OK



$ sudo apt-key fingerprint 0EBFCD88


pub rsa4096 2017-02-22 [SCEA]


 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88


uid [ unknown] Docker Release (CE deb) <docker@docker.com>


sub rsa4096 2017-02-22 [S]



$ sudo add-apt-repository 


>"deb [arch=amd64] https://download.docker.com/linux/ubuntu 


> $(lsb_release -cs) 


> stable"


Hit:1 http://gb.archive.ubuntu.com/ubuntu bionic InRelease


Hit:2 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease 


Hit:3 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease 


Get:4 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] 


Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease 


Fetched 64.4 kB in 0s (141 kB/s)


Reading package lists... Done



robin@xps:~/git/snapcraft.io$ sudo apt-get update


Hit:1 http://gb.archive.ubuntu.com/ubuntu bionic InRelease


Hit:2 http://gb.archive.ubuntu.com/ubuntu bionic-updates InRelease 


Hit:3 http://gb.archive.ubuntu.com/ubuntu bionic-backports InRelease 


Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease 


Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease 


Reading package lists... Done 



$ sudo apt-get install docker-ce


Reading package lists... Done


Building dependency tree 


Reading state information... Done


Package docker-ce 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



E: Package 'docker-ce' has no installation candidate



我的第一个想法是,Docker还没有为Bionic发布一个软件包(它非常新),但是,当我搜索"安装docker-ce ubuntu 18.04 "时,我发现了一个18.04具体的安装指南,基本上只是给出完全相同的方法:

https://linuxconfig.org/how-to-install-docker-on-ubuntu-18-04-bionic-beaver


回答1

从你引用的同一指南中,你可以在此时使用存储库17.10:


deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable



所有docker-ce依赖包都将从ubuntu bionic存储库中解析,不需要担心的兼容性问题:)

2018-07-19更新

Docker 18.06已更新到bionic存储库,不再需要此变通方法!


回答2

docker ce还不能用于Ubuntu 18.04 ,你可以在这里查看受支持版本的列表。

在docker ce支持18.04之前,这是一个解决方法。


回答3

按照在Docker文档中步骤(我这里可以工作)。 只需要在这个命令中更改stable到test


sudo add-apt-repository 


"deb [arch=amd64] https://download.docker.com/linux/ubuntu 


$(lsb_release -cs) 


stable"






文章标签:CAN  APT  candidate  

Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语