ubuntu 16.04 终端安装Docker

搜索与推荐Wiki
《推荐系统开发实战》作者
博客专家认证
2016-12-14 04:33:48
更新APT的源,安装https和ca证书的库,默认这2个库都已经装了。

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates


添加秘钥GPG到APT配置中。

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D


增加Docker的源到/etc/apt/souces.list文件中,我的版本是14.04对应ubuntu-trusty。

sudo vim /etc/apt/sources.list

# 增加到最后一行
deb https://apt.dockerproject.org/repo ubuntu-trusty main

接下来,就可以用可以用apt-get直接安装Docker了。

sudo apt-get update
sudo apt-get install docker-engine

此时会遇到一个错误:
xdstar@ubuntu:/etc/apt$ sudo apt-get install docker-engine
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
docker-engine : Depends: libsystemd-journal0 (>= 201) but it is not installable
Recommends: aufs-tools but it is not going to be installed
Recommends: cgroupfs-mount but it is not going to be installed or
cgroup-lite but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


解决办法:
在source.list 中docker源之前加上
deb http://cz.archive.ubuntu.com/ubuntu trusty main

然后 更新和安装

sudo apt-get update
sudo apt-get install docker-engine


OK!!!
...全文
1439 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
老菜鸟_beyond 2017-08-02
  • 打赏
  • 举报
回复
sudo apt-get install libsystemd-journal0 不行就按官网来一遍 https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-convenience-script
cocoabird 2016-12-15
  • 打赏
  • 举报
回复

23,160

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧