4

I'm extremely new to Linux/command line stuff, so please forgive my ignorance.

Every time I try to install anything using sudo apt-get install ... I get dependency errors. I'm trying to get OpenSSH Server and GitLab installed on my machine, and whenever I type in the commands, I seem to get a dependency error like so:

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.

I get similar errors seemingly no matter what I try to install. For example, with sudo apt-get install git, the error changes to:

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

I'm running Ubuntu Server 12.04 LTS x86. I've tried doing sudo apt-get clean, sudo apt-get autoclean, sudo apt-get update, and sevveral other similar things. I've tried rebooting, hell, I even wiped out the server and started from scratch with the same issue. I'm sure I'm doing something obviously wrong, but I just can't seem to track it down. If anyone could help, that'd be fantastic.


Update: I did get OpenSSH working by clean installing the server and selecting OpenSSH during set up.

I found this wiki on apt-get so I tried doing sudo apt-get build-dep git and got the error:

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

I don't know if that helps determine what's happening.

17
  • 1
    Have you tried this?askubuntu.com/questions/140246/… – g_p Jan 20 '15 at 5:47
  • I haven't, thanks, that looks way more informative than the results I've been getting. I'll give it a shot in the morning. – JacobTheDev Jan 20 '15 at 5:52
  • 1
    Is the setup fully updated? sudo apt-get update && sudo apt-get upgrade and sudo apt-get dist-upgrade You should not be getting these errors. Did you verify the Ubuntu install (.iso file)? – david6 Jan 20 '15 at 6:17
  • 1
    Remove “Hash sum mismatch” error using this and "GPG ERROR" using this. Also it not good idea to give SSH access to anyone. – g_p Jan 20 '15 at 16:37
  • 1
    @Fabby, posted it. – g_p Jan 22 '15 at 11:37
3

Output of sudo apt-get update which you have provided here has two problem

  1. “Hash sum mismatch” error and
  2. "GPG ERROR"

These two problem is already discussed here( for "Hash sum mismatch") and here (for "GPG ERROR").

Resolving these two error will solve your problem as you are not able to fetch the latest version of software available be in the respective repo.

9

To fix that need to do next actions:

  1. sudo apt-get update
  2. sudo apt-get install -f
  3. sudo rm -rf /var/lib/apt/lists/*
  4. sudo apt-get update
1
  • This worked for me, but could you add a clarification as to why the removal of the apt lists directory contents solves this problem? – fooquency Dec 28 '17 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.