1.安装SSH服务
sudo apt-get install openssh-server
2.更换国内源
备份:sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
修改文件:sudo nano /etc/apt/sources.list,并把下面的覆盖掉原文件,然后Ctrl+X 退出保存!
deb http://mirrors.aliyun.com/ubuntu/ xenial main deb-src http://mirrors.aliyun.com/ubuntu/ xenial main deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security main deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
更新源
sudo apt-get update
复损坏的软件包,尝试卸载出错的包,重新安装正确版本的。
sudo apt-get -f install
更新软件
sudo apt-get upgrade
2.更改docker权限,通过将用户添加到docker用户组可以将sudo去掉,命令如下
sudo groupadd docker #添加docker用户组 sudo gpasswd -a $USER docker #将登陆用户加入到docker用户组中 newgrp docker #更新用户组
3.安装docker
sudo apt-get install docker.io