ubuntu 16.04 终端安装Docker

搜索与推荐Wiki 搜索与推荐Wiki 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
更新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!!!
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
搜索与推荐Wiki
搜索与推荐Wiki 《推荐系统开发实战》作者 《推荐系统开发实战》作者领域专家: 物联网技术领域 领域专家: 物联网技术领域
Linux/Unix社区 23,224 成员 74,535 内容