解决docker中oyente无法安装openssh-server的问题

解决docker中oyente无法安装openssh-server的问题:

将容器中的/etc/apt/sources.list文件中的内容替换为

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

之后执行命令

apt-get update

apt-get install openssh-server --fix-missing

若安装openssh-server时提示下面错误:

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:

openssh-server : Depends: openssh-client (= 1:6.6p1-2ubuntu2.13) but 1:7.5p1-10ubuntu0.1 is to be installed

                  Recommends: ncurses-term but it is not going to be installed

                  Recommends: ssh-import-id but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

则需卸载掉默认安装的openssh-client(因版本较新,而openssh-server依赖的版本较旧):

sudo apt-get  autoremove  openssh-client

然后再重新安装它们:

sudo apt-get install openssh-client openssh-server

启动sshd服务:

sudo /etc/init.d/ssh start

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容