关于依赖项:apt-get不安装任何Linux服务器

apt-get not installing anything linux server

任何使用apt-get install都会出现以下错误

You might want to run 'apt-get -f install' to correct these:
The
following packages have unmet dependencies:
openssh-server : Depends:
openssh-client (= 1:6.0p1-4) but 1:6.0p1-4+deb7u2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or
specify a solution).

如果我尝试安装apt-get -f,则会出现以下错误

1
2
3
4
5
6
7
8
reparing to replace openssh-server 1:6.0p1-4 (using .../openssh-server_1%3a6.0p1-4+deb7u2_amd64.deb) ...
Unpacking replacement openssh-server ...
dpkg: error processing /var/cache/apt/archives/openssh-server_1%3a6.0p1-4+deb7u2_amd64.deb (--unpack):
 unable to make backup link of `./usr/sbin/sshd' before installing new version: Operation not permitted
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/openssh-server_1%3a6.0p1-4+deb7u2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo apt-get update也不能完全正常工作。 建议
提前致谢


1
2
3
sudo apt-get update
sudo apt-get -f install
sudo apt-get install openssh-server

如果您不是以root用户身份登录(如我所假设的那样),则应在将软件包添加/删除到系统之前放入sudo

如果那不起作用,请运行以下命令:

1
2
3
4
5
chattr -i /usr/bin/sshd
chattr -a /usr/bin/sshd
sudo apt-get update
sudo apt-get -f install
sudo apt-get install openssh-server

如果这不起作用,您还可以转到/var/lib/dpkg/info/var/cache/apt/archives删除名称接近openssh-server的所有内容。 然后,运行以下命令:

1
2
3
sudo apt-get update
sudo apt-get -f install
sudo apt-get install openssh-server

pd:这很复杂,因此无法访问系统意味着很多"尝试与失败" :(


好的,我尝试了所有这些以及更多方法,但没有一种方法可行。 所以我试图删除openssh-client,然后安装openssh-server,这对我有用。