10

This is on an Ubuntu 12.04 Server.

I'm getting this error when trying to run any apt-get install (trying to install unrelated, arbitrary packages):

dpkg: dependency problems prevent configuration of openssh-server:
 openssh-server depends on openssh-client (= 1:5.9p1-5ubuntu1.1); however:
  Version of openssh-client on system is 1:5.9p1-5ubuntu1.4.
dpkg: error processing openssh-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency probms prevent configuration of ssh:
 ssh depends on openssh-server; however:
  Package openssh-server is not configured yet.
dpkg: error processing ssh (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encounter while processing:
 openssh-server
 ssh
E: Sub-process /usr/bin/dpkg returned an error code (1)

Installing the client version in question leads to:

sudo apt-get install openssh-client=1:5.9p1-5ubuntu1.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '1:5.9p1-5ubuntu1.1' for 'openssh-client' was not found

Various attempts to fix it with lack of background knowledge failed, e.g.

dpkg-reconfigure -a
apt-get -f install

Can somebody give advice how to tackle the problem, possibly demanding more infos that are necessary from my side?

How can the openssh update (that I guess failed) be reverted or taken out of focus, so I am able to install other packages?

Edit:

Output of apt-cache policy openssh-client is:

openssh-client:
  Installed: 1:5.9p1-5ubuntu1.4
  Candidate: 1:5.9p1-5ubuntu1.4
  Version table:
 *** 1:5.9p1-5ubuntu1.4 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:5.9p1-5ubuntu1.3 0
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     1:5.9p1-5ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Just for completeness the /etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
4
  • what does this output brings you? apt-cache policy openssh-client obviously you're trying to install some package that was not developed or tested with your current openssh-client
    – JoKeR
    Mar 31, 2015 at 9:46
  • See output above as edit. I would rather not install the client, just want to get it cleared from apt conflicts to install other packages.
    – rdoubleui
    Mar 31, 2015 at 9:50
  • 1
    here you'll find all the detailed workarounds that you can apply askubuntu.com/questions/140246/…
    – JoKeR
    Mar 31, 2015 at 9:53
  • Remove these packages, answer added Mar 31, 2015 at 9:54

2 Answers 2

24

Just remove these packages to let you use apt for other packages. Execute this commands in terminal.

sudo apt-get remove openssh-server openssh-client --purge && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get update

Then reinstall openssh server and client .

sudo apt-get install openssh-server openssh-client
8
  • 6
    I don't want to remove the openssh-server, as I'm connected via ssh to this machine.
    – rdoubleui
    Mar 31, 2015 at 10:11
  • And just removing the client leads to the same dependency error.
    – rdoubleui
    Mar 31, 2015 at 10:17
  • remove server also then reinstall server and client Mar 31, 2015 at 10:32
  • 2
    Removing ssh openssh-server and openssh-client and reinstall worked for me, thanks.
    – rdoubleui
    Mar 31, 2015 at 11:13
  • 1
    You may find that the file /etc/ssh/sshd_config is missing, you need to create it for some systems: sudo touch /etc/ssh/sshd_config if it isn't there.
    – PeterS
    Jun 9, 2020 at 22:47
1

When removing/purging openssh-server and openssh-client are not an option (for example when another package depends on them)

This did the trick for me:

sudo dpkg -i /var/cache/apt/archives/openssh-*.deb
sudo dpkg --configure -a

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .