Cannot install build-essential

Ubuntu Version: Ubuntu 24.04.3 LTS

Desktop Environment (if applicable): the default one

Problem Description:

I cannot install build-essential package:

sru@riou-sebastien-pqshield:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:3 https://packages.microsoft.com/ubuntu/24.04/prod noble InRelease
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
sru@riou-sebastien-pqshield:~$ sudo apt upgrade
Reading package lists… DoneBuilding dependency tree… DoneReading state information… DoneCalculating upgrade… DoneGet more security updates through Ubuntu Pro with ā€˜esm-apps’ enabled:libzvbi-common libavcodec60 libzvbi0t64 libavutil58 libswresample4Learn more about Ubuntu Pro at https://ubuntu.com/pro0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sru@riou-sebastien-pqshield:~$ sudo apt install build-essential
Reading package lists… DoneBuilding dependency tree… DoneReading state information… DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:
The following packages have unmet dependencies:bzip2 : Depends: libbz2-1.0 (= 1.0.8-5.1) but 1.0.8-5.1build0.1 is to be installedE: Unable to correct problems, you have held broken packages.

I have just installed Ubuntu 24.04.3 LTS leaving everything as default. I also had problems earlier to install pulseaudio, it seems something is wrong in package manager settings.

Relevant System Information:
Dell Inc. Dell Pro Max 14 MC14255

Screenshots or Error Messages:
The following packages have unmet dependencies:bzip2 : Depends: libbz2-1.0 (= 1.0.8-5.1) but 1.0.8-5.1build0.1 is to be installedE: Unable to correct problems, you have held broken packages.

What I’ve Tried:
I have read Can not longer install rocm, not even build-essential - #12 by krytern at some points it says ā€œcheck the output of apt update, it should contain ā€˜noble-updateā€™ā€. Well in my case it does not, but I don’t know how to it.

1 Like

another unexpected issue in the same line:

sru@riou-sebastien-pqshield:~/test/crypto-benchmark-stm32u5$ sudo apt install python3-dev -y
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:
 zlib1g-dev : Depends: zlib1g (= 1:1.3.dfsg-3.1ubuntu2) but 1:1.3.dfsg-3.1ubuntu2.1 is to be installed
E: Unable to correct problems, you have held broken packages.

Yes, you should check your software sources.

You can do it easily by opening ā€œSoftware & Updatesā€. In the first tab make sure all the first four are selected (no need for source code). In the second tab you can check third-party repositories (PPAs).

all the first four are checked. I removed them and rechecked them and rebooted. I still have the same problem.

I do not expect to need any third-party repository to get build-essential, is that correct ?

100% correct. That said, if you added some PPA that conflicts with versions in the official repository that will cause issues.

Feel free to elaborate on this as it may give clues to something else.

I have just two third party repositories:

for pulse audio, I did the following (extract from history):
14 pactl list short sources
15 sudo apt update
16 sudo apt install pulseaudio-utils (did not work)
17 dpkg --get-selections | grep hold
18 sudo apt-get autoremove
19 sudo apt update
20 sudo apt upgrade -y
21 sudo apt autoremove
22 sudo apt install pulseaudio-utils (did not work)
23 sudo apt install pulseaudio (did not work)
24 sudo alsa force-reload
25 sudo apt-get install alsa-utils linux-sound-base
26 sudo apt-get install pulseaudio (did not work)
27 snap install pulseaudio (did not work)
28 systemctl --user restart pulseaudio
29 systemctl status pipewire
30 sudo apt install pulseaudio pulseaudio-utils (did not work)
31 sudo dpkg -P --force-depends libpulse0
32 sudo dpkg -P --force-depends libpulse-mainloop-glib0
33 sudo apt install libpulse0/noble-updates
34 sudo apt --fix-broken install
35 sudo apt install pulseaudio

the last one worked, I have now version ā€˜1:16.1+dfsg1-2ubuntu10’

ogra@anubis:~$ apt policy zlib1g-dev
zlib1g-dev:
  Installiert:           1:1.3.dfsg-3.1ubuntu2.1
  Installationskandidat: 1:1.3.dfsg-3.1ubuntu2.1
  Versionstabelle:
 *** 1:1.3.dfsg-3.1ubuntu2.1 500
        500 http://de.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:1.3.dfsg-3.1ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu noble/main amd64 Packages
ogra@anubis:~$ apt policy zlib1g
zlib1g:
  Installiert:           1:1.3.dfsg-3.1ubuntu2.1
  Installationskandidat: 1:1.3.dfsg-3.1ubuntu2.1
  Versionstabelle:
 *** 1:1.3.dfsg-3.1ubuntu2.1 500
        500 http://de.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:1.3.dfsg-3.1ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu noble/main amd64 Packages
ogra@anubis:~$ apt changelog zlib1g-dev |head -8

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

Holen:1 https://changelogs.ubuntu.com zlib 1:1.3.dfsg-3.1ubuntu2.1 Changelog [48,0 kB]
zlib (1:1.3.dfsg-3.1ubuntu2.1) noble-proposed; urgency=medium

  * SRU: LP: #2076340: No-change rebuild to pick up changed build flags
    on ppc64 and s390x.

 -- Matthias Klose <doko@ubuntu.com>  Fri, 09 Aug 2024 04:33:20 +0200

ogra@anubis:~$ 

Looking at my 24.04.3 system over here it shows that the blocking package sits in the noble-updates pocket and checking the changelog entry for it shows that it does sit there since August 2024 already …

Do you have the noble-updates pocket enabled ?

1 Like

Hi, thanks for the information. the thing is that I do not know how to check if I have noble-updates enabled. How can I check ?

output on my side:

sru@riou-sebastien-pqshield:~$ apt policy zlib1g-dev
zlib1g-dev:
Installed: (none)
Candidate: 1:1.3.dfsg-3.1ubuntu2
Version table:
1:1.3.dfsg-3.1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu` noble/main amd64 Packages`

Take a look at the sources file for apt, it should look like that (with noble-updates and noble-securityin it, at least the latter is very important):

ogra@anubis:~$ cat /etc/apt/sources.list.d/ubuntu.sources
Types: deb deb-src
URIs: http://de.archive.ubuntu.com/ubuntu/
Suites: noble noble-updates
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb deb-src
URIs: http://security.ubuntu.com/ubuntu
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
ogra@anubis:~$

EDIT: sorry, edited the output, my file still had the original 12.04 (precise) entries in it (not sure how they got there at all given that the file format for apt changed a lot since)

3 Likes

success!

noble-updates was missing in that file. I don’t understand how that happened.

Thanks a lot.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.