0

Using Debian Stretch v9.11.

I try to install build-essential, but fails because of unmet dependencies:

sudo apt install build-essential
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:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: g++ (>= 4:6.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt-cache policy shows:

apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://security.debian.org/debian-security stretch/updates/non-free amd64 Packages
     release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=non-free,b=amd64
     origin security.debian.org
 500 http://security.debian.org/debian-security stretch/updates/contrib amd64 Packages
     release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=contrib,b=amd64
     origin security.debian.org
 500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
     release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://deb.debian.org/debian stretch/non-free amd64 Packages
     release v=9.11,o=Debian,a=oldstable,n=stretch,l=Debian,c=non-free,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian stretch/contrib amd64 Packages
     release v=9.11,o=Debian,a=oldstable,n=stretch,l=Debian,c=contrib,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian stretch/main amd64 Packages
     release v=9.11,o=Debian,a=oldstable,n=stretch,l=Debian,c=main,b=amd64
     origin deb.debian.org

I have following content in /etc/apt/sources.list:

# deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 DVD Binary-1 20180714-10:25]/ stretch contrib main

deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free

# deb http://deb.debian.org/debian stretch-updates main
# deb-src http://deb.debian.org/debian stretch-updates main


# deb http://deb.debian.org/debian-security/ stretch/updates main
# deb-src http://deb.debian.org/debian-security/ stretch/updates main

deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free

# add backports
# deb http://ftp.debian.org/debian stretch-backports main


# stretch-updates, previously known as 'volatile'
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://deb.debian.org/debian/ stretch-updates main contrib
# deb-src http://deb.debian.org/debian/ stretch-updates main contrib

EDIT1: apt-cache policy libc6-dev shows:

apt-cache policy libc6-dev
libc6-dev:
  Installed: (none)
  Candidate: 2.24-11+deb9u4
  Version table:
     2.24-11+deb9u4 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
     2.24-11+deb9u1 500
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages

apt-cache policy g++ shows:

apt-cache policy g++
g++:
  Installed: (none)
  Candidate: 4:6.3.0-4
  Version table:
     4:6.3.0-4 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages

EDIT2: I had deb http://ftp.de.debian.org/debian buster main in /etc/apt/sources.list.d/.mc.list

I remember, that once I had to install a newer mc, which had specific bugfix.

EDIT3:

apt update
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch Release
Fetched 94.3 kB in 1s (69.7 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

apt-get install --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

How can I fix the unmet dependencies?

2 Answers 2

0

Finally I got help in another forum: https://serverfault.com/a/1004951/302842

This was the solution to downgrade the problematic packages:

apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch libc-bin/stretch locales/stretch sudo/stretch

The downgrade was successful!

0

I had a similar issue.I resolve it by doing this:

Before starting,if you don't have aptitude, you can install it by following these instructions:aptitude documentation

If you have it already,you can move on. First you need to run:

sudo aptitude install g++

It will be ask this: Accept this solution? [Y/n/q/?] You must select "n".

It will suggest you to downgrade the package,and it will be ask this: Accept this solution? [Y/n/q/?]This time select "Y".

It will downgrade the package. After it is done,you can now install build-essential by doing this:

sudo aptitude -f install build-essential

It will be ask this: Accept this solution? [Y/n/q/?] You must select "Y".

It will install it.After it is done,you can run this command to check it:

sudo aptitude search build-essential

if you see this line in the result:

i build-essential - Informational list of build-essential pack

it means that the installation was successful,but if you don't see it then you have look for another solution in order to resolve it.

You must log in to answer this question.

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