【原文链接:http://chenxuhua.com/blog/ubuntu-install-openssh-server/】
Ubuntu16.04 桌面版默认是没有安装 SSH 服务的,需要手动安装服务:
-
更新源:
sudo apt-get update
-
安装服务:
sudo apt-get install -y openssh-server
-
确认服务是否顺利启动:
ps -e | grep sshd
常见报错
「Could not get lock /var/lib/apt/lists/lock /var/lib/dpkg/lock」问题解决方法
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
上述报错意思是进行 apt-get 操作时被 lock 住了,出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用(大概率是上次运行安装或更新时没有正常结束),进而出现此状况,解决的办法其实很简单,在终端中敲入以下命令:
sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
执行完成后,再次更新一下就可以了。
sudo apt-get update