skip to Main Content

My os info:

uname -a
Linux debian 5.10.0-22-amd64 #1 SMP Debian 5.10.178-3 (2023-04-22) x86_64 GNU/Linux

I want to install build-essential:

sudo apt install  build-essential
Reading package lists... Done
Building dependency tree... Done
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-dev : Depends: libc6 (= 2.31-13+deb11u6) but 2.36-9 is to be installed
             Depends: libc-dev-bin (= 2.31-13+deb11u6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Fix the broken can’t solve the issue:

sudo apt update
sudo apt-get --fix-broken install

Install with specified version:

output info

If i post all text,SO says too many codes!So i upload the image.
Install dbus-user-session:

sudo apt install dbus-user-session
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
dbus-user-session is already the newest version (1.12.24-0+deb11u1).
dbus-user-session set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
debian@debian:~$ sudo apt install dbus=1.12.24-0+deb11u1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
dbus is already the newest version (1.12.24-0+deb11u1).
dbus set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

It seems no problem for dbus-user-session,same output for the following installation:

sudo apt install  evince libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-0
sudo apt install  libjavascriptcoregtk-4.0-18  liborcus-0.16-0   libpoppler102  libwebkit2gtk-4.0-37 yelp

No error info for all of them.

2

Answers


  1. Always just before any installation or upgrade by apt, please issue

    sudo apt update
    

    to update the package database. You should suppose, this data updates almost continuously (its depending on the update policy of your mirror you usually do not know). Using an outdated copy will generate issues to installations and upgrades.

    => Check the output for any issues (and paste it here in the question).

    The minimal variant to solve this is to force the explicit installation of the required libc6 version, as it is not the latest (the latest would be installed by default):

    sudo apt install libc6=2.31-13+deb11u6  libc-dev-bin=2.31-13+deb11u6
    

    If this succeeds your build-essential should install:

    sudo apt install build-essential
    

    => If errors occur, paste them as update to your question.


    Update

    I suspect your system is not up to date. This might be by not having done a flawless sudo apt upgrade or also might be because your package source server is not up to date.

    What’s the output of the command :
    (Do not use sudo as we don’t want to change anything, yet.)

    apt upgrade <<<n
    

    If the system is not up to date: Are there any reasons that you don’t want to upgrade your installation?

    Which are the mirrors for your Debian packages?

    cat /etc/apt/sources.list /etc/apt/sources.list.d/*
    

    The next steps I would suggest:

    1. Check your mirror and if necessary change to a Debian mirror known to be current.
    2. Do a sudo apt update
    3. Do a sudo apt upgrade and check for errors in output.
    4. If no errors, then try sudo apt install build-essential
    Login or Signup to reply.
  2. I have the same problem. I suppose you tried to upgrade to Debian bookworm but the upgrade didn’t complete. For my part, I’m on raspberry pi and upgrading to bookworm is not supported, so my system is half bookworm and half bullseye.

    libc6 is 2.36-9 which is from bookworm, while some packages expect to have libc6 to version 2.31-13+deb11u6

    I guess I have to install my system. It’s working quite fine, but I can’t compile anything because I can’t install libc6-dev 2.31 or 2.36

    (edit: as a workaround, I’ve added the bookworm repo, it might break my system but at least I’ve managed to install libc6-dev)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search