0

I recently did a fresh install of Ubuntu, I got into a mess trying to install gcc-4.8, I've tried a few different things and now I'm stuck trying to get back to where I started.

#> sudo apt-get install build-essential
The following packages have unmet dependencies.
 build-essential : Depends: gcc (>= 4:4.4.3) but it is not going to be installed
                   Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

#> sudo apt-get install gcc
The following packages have unmet dependencies.
 gcc : Depends: gcc-4.8 (>= 4.8.1-4~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I have removed as much gcc-related stuff as I can. I think the only gcc-* package installed at the moment is gcc-4.8-base:amd64 but if I try to remove that:

libgcc1 : Depends: gcc-4.8-base (= 4.8.2-1ubuntu1) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Likewise the only libgcc-* package installed is libgcc1:amd64 and it I try to remove that:

The following packages have unmet dependencies.
 libc6 : Depends: libgcc1 but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Trying to remove anything libc6 related gives me some scary-looking options and doesn't make sense.

This is my sources.list at the moment, I've disabled some things and updated.

# deb cdrom:[Kubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)]/ saucy main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ saucy main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ saucy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://gb.archive.ubuntu.com/ubuntu/ saucy-updates main restricted
deb-src http://gb.archive.ubuntu.com/ubuntu/ saucy-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://gb.archive.ubuntu.com/ubuntu/ saucy universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ saucy universe
deb http://gb.archive.ubuntu.com/ubuntu/ saucy-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ saucy-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://gb.archive.ubuntu.com/ubuntu/ saucy multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ saucy multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ saucy-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ saucy-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 http://gb.archive.ubuntu.com/ubuntu/ saucy-backports main restricted universe multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ saucy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu saucy-security main restricted
deb-src http://security.ubuntu.com/ubuntu saucy-security main restricted
deb http://security.ubuntu.com/ubuntu saucy-security universe
deb-src http://security.ubuntu.com/ubuntu saucy-security universe
deb http://security.ubuntu.com/ubuntu saucy-security multiverse
deb-src http://security.ubuntu.com/ubuntu saucy-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu saucy partner
# deb-src http://archive.canonical.com/ubuntu saucy partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu saucy main
# deb http://archive.canonical.com/ saucy partner
# deb-src http://archive.canonical.com/ saucy partner
# deb-src http://extras.ubuntu.com/ubuntu saucy main
# deb-src http://archive.canonical.com/ saucy partner

I don't understand the apt errors. I know very little about apt in general. The error messages don't make sense, I don't understand why multiple versions of gcc can't coexist (they did on a previous installation) or how it's possible that any installed packages would prevent further packages from being installed. I don't know how to get any more information about the problem.

At the moment my goal is to get rid of all gcc-4.8 related stuff and just have a standard gcc (whatever version) installed. What do I do?

Thanks

3 Answers 3

1

Using aptitude instead of apt-get I was able to downgrade existing packages and then install as normal.

0

Googling your error reveals the answer over on Ask Ubuntu -- it seems you've "held" a package (I'd wager GCC) at an earlier version, and that's causing apt-get to fail to resolve dependencies that require a more recent version.

To un-hold the package, follow the link in the comments on that answer, which will take you to another question also answered over there.

0

You could always uninstall all the gcc's you find. You can query the gcc packages you have installed via dpkg -l Cheat Sheet and uninstall via apt-get purge gcc Cheat Sheet. A fresh install of the gcc's you are looking after this should resolve the error you are having. Remember to run a apt-get autoremove/autoclean after to keep everything clean :). Hope this helps.

You must log in to answer this question.

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