无法安装任何东西,依赖错误

Jac*_*Dev 4 server apt dependencies git software-installation

我对 Linux/命令行的东西非常陌生,所以请原谅我的无知。

每次我尝试使用安装任何东西时sudo apt-get install ...都会出现依赖错误。我正在尝试在我的机器上安装 OpenSSH Server 和 GitLab,每当我输入命令时,我似乎都会收到这样的依赖错误:

sudo apt-get install openssh-server
reading package lists... 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: libwrap0 (>= 7.6-4~) but it is not installable
                  Recommends: ssh-import-id but it is not installable
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

无论我尝试安装什么,我似乎都会遇到类似的错误。例如,使用sudo apt-get install git,错误更改为:

The following packages have unmet dependencies:
 git : Depends: liberror-perl but it is not installable
E: Unable to correct problems, you have held broken packages
Run Code Online (Sandbox Code Playgroud)

我正在运行 Ubuntu Server 12.04 LTS x86。我试着做sudo apt-get cleansudo apt-get autocleansudo apt-get update,和sevveral其他类似的东西。我试过重新启动,见鬼,我什至清除了服务器并从头开始遇到同样的问题。我确定我在做一些明显错误的事情,但我似乎无法追踪它。如果有人可以提供帮助,那就太棒了。


更新:我确实通过全新安装服务器并在设置期间选择 OpenSSH 来使 OpenSSH 工作。

在 apt-get 上找到了这个 wiki,所以我尝试这样做sudo apt-get build-dep git并得到了错误:

E: Build-Depends-Indep dependency for git cannot be satisfied because package asciidoc has no candidate version

我不知道这是否有助于确定发生了什么。

小智 9

要解决该问题,需要执行下一步操作:

  1. sudo apt-get 更新
  2. sudo apt-get install -f
  3. 须藤 rm -rf /var/lib/apt/lists/*
  4. sudo apt-get 更新