4

I'm trying to install openssh-server. However, I keep getting this error:

The following packages have unmet dependencies:
 libc6 : Breaks: openssh-server (< 1:8.1p1-5) but 1:7.9p1-10+deb10u2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

I tried to replicate various solutions but was unsuccessful. One limitation is that I'm not allowed to do an apt upgrade on all packages. I have to be specific on what I can upgrade.

Here are the commands I've executed when trying to install openssh-server:

~$ apt search libc6 | grep -i installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libc6/unstable,now 2.31-9 amd64 [installed]
libtext-iconv-perl/stable,now 1.7-5+b7 amd64 [installed]

~$ ls -lh /var/cache/apt/archives/libc6_2*
-rw-r--r-- 1 root root 2.7M Dec 17 08:41 /var/cache/apt/archives/libc6_2.31-6_amd64.deb
-rw-r--r-- 1 root root 2.7M Jan  5 15:29 /var/cache/apt/archives/libc6_2.31-9_amd64.deb

~$ sudo apt-get install --only-upgrade libc6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  glibc-doc
The following packages will be upgraded:
  libc6
1 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.
Need to get 2,812 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Get:1 https://deb.debian.org/debian unstable/main amd64 libc6 amd64 2.31-9 [2,812 kB]
Fetched 2,812 kB in 2s (1,475 kB/s)                     
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 165941 files and directories currently installed.)
Preparing to unpack .../libc6_2.31-9_amd64.deb ...
Unpacking libc6:amd64 (2.31-9) over (2.31-6) ...
Setting up libc6:amd64 (2.31-9) ...
Processing triggers for libc-bin (2.31-6) ...

~$ sudo apt-get install 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:
 libc6 : Breaks: openssh-server (< 1:8.1p1-5) but 1:7.9p1-10+deb10u2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Contents of sources.list:

deb https://deb.debian.org/debian buster main contrib non-free
deb-src https://deb.debian.org/debian buster main contrib non-free

deb https://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb-src https://deb.debian.org/debian-security/ buster/updates main contrib non-free

deb https://deb.debian.org/debian buster-updates main contrib non-free
deb-src https://deb.debian.org/debian buster-updates main contrib non-free

Please let me know how I can resolve this issue. Thanks in advance.

tried solutions:

  1. https://warlord0blog.wordpress.com/2020/08/14/libc6-and-openssh/
  2. Cannot install sshd (openssh-server) on debian 10.4

[Edit 2]: Updated output of apt-cache policy

~$ apt-cache policy libc6 openssh-server
libc6:
  Installed: 2.31-9
  Candidate: 2.31-9
  Version table:
 *** 2.31-9 100
        100 /var/lib/dpkg/status
     2.28-10 900
        900 http://deb.debian.org/debian buster/main amd64 Packages
openssh-server:
  Installed: (none)
  Candidate: 1:7.9p1-10+deb10u2
  Version table:
     1:8.4p1-2~bpo10+1 100
        100 http://deb.debian.org/debian buster-backports/main amd64 Packages
     1:7.9p1-10+deb10u2 900
        900 http://deb.debian.org/debian buster/main amd64 Packages
     1:7.9p1-10+deb10u1 900
        900 http://deb.debian.org/debian-security buster/updates/main amd64 Packages
br1on3n
  • 41
  • 3
  • 1
    As the error message says, this is probably caused by a held package. Please show us the output of `apt-cache policy libc6 openssh-server`. – Andrew Schulman Jan 11 '21 at 17:28
  • 1
    @AndrewSchulman Thank you for your response. I've edited the body of my post and added the output for reference. – br1on3n Jan 11 '21 at 18:21
  • 1
    Oh, you have mixed unstable repos with stable repos. That will do it. – Michael Hampton Jan 11 '21 at 22:25
  • 1
    @MichaelHampton I've updated the output of `apt-cache policy` but I'm still not sure what to do after what I've already executed. `dpkg --get-selections | grep hold` returns no output. And I'm still getting the same error when I try to `apt install openssh-server`. – br1on3n Jan 12 '21 at 05:31
  • 2
    Hm, more to the point, you've installed libc6 from unstable, which has broken your system. (Far more than openssh is going to have a problem with this; try not to restart anything yet.) You need to replace that with libc6 from buster. – Michael Hampton Jan 12 '21 at 06:05
  • @MichaelHampton Isn't my libc6 package already from buster? When I `sudo apt-show-versions | grep unstable`, it returns nothing. I'm more confused at this point. Perhaps you are referring to the initial post? Previously, I made some adjustments to the sources.list file and posted the updated output of `apt-cache policy`. – br1on3n Jan 12 '21 at 13:32
  • I checked the other versions available for libc6, but I didn't expect that it had so many dependencies. It is potentially harmful to downgrade this package. So, I didn't proceed with that option. – br1on3n Jan 12 '21 at 13:40
  • It's harmful to leave this package installed. It would be perfectly safe to replace it with the latest available package for buster. – Michael Hampton Jan 12 '21 at 17:39
  • @MichaelHampton `apt` will not allow me to remove libc6 alone, it wants to remove all other dependencies along with it. I'm thinking that maybe I can download libc6=2.28-10 and `sudo dpkg --remove --force-depends libc6` then `sudo dpkg -i libc6_2.28-10_amd64.deb`. Does that sound like a good idea? I need to be absolutely sure of what I'm about to do and that this approach will not cause havoc on my system. – br1on3n Jan 13 '21 at 04:58
  • No, you should not remove it, just downgrade it. Removing it would make virtually everything stop working. – Michael Hampton Jan 13 '21 at 05:44
  • @MichaelHampton I did the downgrade without removing anything as you suggested. Now my libc6 is version 2.28-10 buster. However, my system is now broken. I cannot even login to the computer because I think the gnome desktop manager is broken too. I'm writing this from a different computer. How can I fix everything back to normal? – br1on3n Jan 14 '21 at 06:18

1 Answers1

-1

It seems your sources list is incorrect.

open and see if the version is "Strech" in the </etc/apt/sources.list>

If not update and save. then run #apt-get update and try to install :)