2

I was trying to upgrade gcc-4.8.1 to gcc-4.8.2 using Synaptic from this PPA. The installation executed with no problem, but suddenly I had no gcc-4.8 at all. I was using gcc-4.7 and gcc-4.8 together, but only 4.7 is left for some reason. Then I tried to reinstall gcc-4.8 using apt-get install but I got unmet dependencies errors. I tried to solve this problem using the answers to this question, but to no avail.

sudo apt-get install gcc-4.8

results in:

...
The following packages have unmet dependencies:
 gcc-4.8 : Depends: binutils (>= 2.23.90.20131017) but
2.23.52.20130913-0ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.

Here are the outputs of:

martin@martin-Studio-1537:~$ cat /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu saucy main universe restricted multiverse
deb http://security.ubuntu.com/ubuntu/ saucy-security main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu saucy-updates main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu saucy-proposed main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu saucy main universe restricted multiverse #Added by software-properties
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu saucy main

and

martin@martin-Studio-1537:~$ cat /etc/apt/sources.list.d/*
# deb http://download.mendeley.com/apt/ stable main
deb http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
deb-src http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
deb http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
# deb-src http://ppa.launchpad.net/p12/qtcreator/ubuntu saucy main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu saucy main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu saucy main
# deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main
# deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main
# deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main
# deb-src http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu saucy main

I tried to repeat the suggestions in the answers after disabling all PPAs and then again with the gcc-4.8.2 PPA enabled and I still cannot install gcc-4.8.2.

What did I do wrong and how can I fix my system?

EDIT:

I tried

martin@martin-Studio-1537:~$ sudo apt-get install -f
[sudo] password for martin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

and then

sudo apt-get update

but the result is the same.

I tried everything in this answer with the exception of purging or removing PPAs.

EDIT2:

I followed instructions from searchforgold6789's answer and it did work! I successfully installed gcc-4.8.1. But when I added the PPA again and tried to upgrade, I got the following output:

The following packages have been kept back:
  cpp-4.8 g++-4.8 gcc-4.8 gcc-4.8-base libasan0 libatomic1 libgcc-4.8-dev
  libgcc1 libgcc1-dbg libgfortran3 libgomp1 libitm1 libquadmath0
  libstdc++-4.8-dev libstdc++6 libstdc++6-4.8-dbg
The following packages will be upgraded:
  libcloog-isl4 libisl10
2 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.

EDIT3:

When I do a apt-get dist-upgrade it suggests that g++-4.8 gcc-4.8 should be removed. Why is this so? Should I proceed? I think this was the reason I got into this trouble in the first place.

martin@martin-Studio-1537:~$ sudo apt-get dist-upgrade
...
The following packages will be REMOVED:
  g++-4.8 gcc-4.8
The following packages will be upgraded:
  cpp-4.8 gcc-4.8-base libasan0 libatomic1 libgcc-4.8-dev libgcc1 libgcc1-dbg
  libgfortran3 libgomp1 libitm1 libquadmath0 libstdc++-4.8-dev libstdc++6
  libstdc++6-4.8-dbg
14 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 14.9 MB of archives.
After this operation, 32.4 MB disk space will be freed.
0

2 Answers 2

7

First you should clean up the old ppa...

sudo apt-get install ppa-purge 
sudo ppa-purge ppa:ubuntu-toolchain-r/test

Then, go into Software Sources and make sure you have the universe and multiverse repositories enabled. Do:

sudo apt-get update

Then you should be able to install gcc-4.8:

sudo apt-get install gcc-4.8

After that, I would be highly surprised if you could not add the PPA and try again with GCC 4.8.2, successfully.

5
  • Thank you! It worked to an extent. However I still cannot upgrade to 4.8.2. Please, could you look at my EDIT2? Feb 23, 2014 at 3:53
  • You should just tap Enter when you see that message.
    – Richard
    Feb 23, 2014 at 3:56
  • @searchforgold6789 but the problem is that the packages that I am trying to install are "held back". How can I make them un-(held back)? Or is this a topic for a different question? Feb 23, 2014 at 4:01
  • You should use sudo apt-get dist-upgrade.
    – Richard
    Feb 23, 2014 at 4:03
  • @searchforgold6789 I did so, but it suggests that gcc 4.8 and g++ 4.8 be removed (see Edit3). Is this OK? Can I install them after? Feb 23, 2014 at 4:08
1

Try :

apt-get install -f

apt-get update 
1
  • Thank you! I edited my question to add the output of these commands. Feb 23, 2014 at 2:23

You must log in to answer this question.

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