1

UPDATE: I have re-installed (3 times) Ubuntu, and performed sudo apt policy libc6 libc6-dev with this output:

libc6:
  Installed: 2.35-0ubuntu3.1
  Candidate: 2.35-0ubuntu3.1
  Version table:
 *** 2.35-0ubuntu3.1 100
        100 /var/lib/dpkg/status
N: Unable to locate package libc6-dev

I then did a sudo apt update and another sudo apt policy libc6 libc6-dev and got this output:

libc6:
  Installed: 2.35-0ubuntu3.1
  Candidate: 2.35-0ubuntu3.1
  Version table:
 *** 2.35-0ubuntu3.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
libc6-dev:
  Installed: (none)
  Candidate: 2.35-0ubuntu3.1
  Version table:
     2.35-0ubuntu3.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

I then was able to perform sudo apt-get install build-essential gdb g++ successfully.

Thank you @steeldriver for looking into this issue with me. I don't know how to close this Question; I suppose the Moderators will eventually do that. Cheers!!


I am running into the same problems as stated in an older question (July 2018), but now (Dec 2022) with a newer version of Ubuntu (22.04 LTS).

When installing the g++ compiler and gdb debugger using sudo apt-get install build-essential gdb g++ I get the following output, with an error for libc6-dev :

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gdb is already the newest version (12.0.90-0ubuntu1).
gdb set to manually installed.
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-dev : Depends: libc6 (= 2.35-0ubuntu3) but 2.35-0ubuntu3.1 is to be installed E: Unable to correct problems, you have held broken packages.

This is the output of cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy
ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

The last comment offered by user Olimjon in that question recommends a clean installation of Ubuntu, which I have done twice, but the problem persists.

Ultimately, my goal is to follow the tutorial on OpenGL by Victor Gordan, however, I am not able to compile and run the examples successfully.

Any suggestions on how to repair the libc6-dev dependencies?

Additional & Updated Information:

Output of apt policy libc6 libc6-dev is

libc6:
  Installed: 2.35-0ubuntu3.1
  Candidate: 2.35-0ubuntu3.1
  Version table:
 *** 2.35-0ubuntu3.1 100
        100 /var/lib/dpkg/status
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
libc6-dev:
  Installed: (none)
  Candidate: 2.35-0ubuntu3
  Version table:
     2.35-0ubuntu3 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

The sources.list file contains:

# deb cdrom:[Ubuntu 22.04.1 LTS _Jammy Jellyfish_ - Release amd64 (20220809.1)]/ jammy main restricted

See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

newer versions of the distribution.

deb http://us.archive.ubuntu.com/ubuntu/ jammy main restricted

deb-src http://us.archive.ubuntu.com/ubuntu/ jammy main restricted

Major bug fix updates produced after the final release of the

distribution.

deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates main restricted

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team. Also, please note that software in universe WILL NOT receive any

review or updates from the Ubuntu security team.

deb http://us.archive.ubuntu.com/ubuntu/ jammy universe

deb-src http://us.archive.ubuntu.com/ubuntu/ jammy universe

deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates universe

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team, and may not be under a free licence. Please satisfy yourself as to

your rights to use the software. Also, please note that software in

multiverse WILL NOT receive any review or updates from the Ubuntu

security team.

deb http://us.archive.ubuntu.com/ubuntu/ jammy multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ jammy multiverse

deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-updates multiverse

N.B. software from this repository may not have been tested as

extensively as that contained in the main release, although it includes

newer versions of some applications which may provide useful features.

Also, please note that software in backports WILL NOT receive any review

or updates from the Ubuntu security team.

deb-src http://us.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu jammy-security main restricted

deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted

deb http://security.ubuntu.com/ubuntu jammy-security universe

deb-src http://security.ubuntu.com/ubuntu jammy-security universe

deb http://security.ubuntu.com/ubuntu jammy-security multiverse

deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse

This system was installed using small removable media

(e.g. netinst, live or single CD). The matching "deb cdrom"

entries were disabled at the end of the installation process.

For information about how to configure apt package sources,

see the sources.list(5) manual.

  • Have you modified your repository sources - for example enabling and then subsequently disabling the jammy-updates/main repository? – steeldriver Dec 02 '22 at 12:40
  • @steeldriver - No, I have not modified anything. – Jorge O-L Dec 02 '22 at 12:45
  • OK well please [edit] your question to include the output of apt policy libc6 libc6-dev – steeldriver Dec 02 '22 at 12:50
  • Your apt policy outputs look weird - like you don't actually have ANY repositories enabled (as though your /etc/apt/sources.list file is empty or all commented out) – steeldriver Dec 02 '22 at 13:14
  • @steeldriver -- you are correct, my bad. I was in the middle of following the instructions in that other question. I have updated the output of 'apt policy libc6 libc6-dev'. Sorry!! – Jorge O-L Dec 02 '22 at 13:20
  • OK so somehow you have managed to install a newer version of libc6 (2.35-0ubuntu3.1) than is available in your currently configured sources (jammy/main). Does jammy-updates/main appear in your sources.list? Was it added at some point then commented out? – steeldriver Dec 02 '22 at 13:50
  • I have added the contents of sources.list. And also, in case it is relevant, I am using a USB drive for the installations. – Jorge O-L Dec 02 '22 at 13:57
  • Looks like I have the same problem (libc6 2.35-0ubuntu3.1 is installed but the corresponding "jammy-updates" repo is not enabled, therefore libc6-dev cannot be installed later). And https://askubuntu.com/questions/1434778/cant-install-libc6i386-on-jammy and https://askubuntu.com/questions/1429323/ubuntu-22-04-issue-cannot-install-libc6-dev-you-have-held-broken-packages look like that as well. My current guess is that this is a bug in Ubuntu or in some 3rd-party repository (maybe in Nvidia repo?). I'll try to find out more. – oliver Jan 10 '23 at 08:58
  • No idea what caused this. The upgrade from libc6 2.35-0ubuntu3 to 2.35-0ubuntu3.1 was installed a few days after we installed this host; and /var/log/apt/history.log.3.gz just gives "Commandline: aptdaemon role='role-commit-packages' sender=':1.112'" as the reason. Btw. we have the 3rd-party repos from docker.com and nvidia.github.io enabled; maybe that made a difference. I've enabled the jammy-updates repo now, and that fixed it for me (I can install build-essential now). – oliver Jan 10 '23 at 09:18

0 Answers0