Why does apt-get want to remove gcc-4.8 and g++-4.8 when I try to upgrade?

5,431

Solution 1

gcc 4.8.2 is currently under development and will only be released for trusty(14.04LTS).

The current latest version available for Ubuntu 13.10 saucy is 4.8.1 and it will not be updated to 4.8.2

Solution 2

You are getting this message as you have broken packages in your system. To be sure try this in your terminal,

dpkg -l | grep "^rc" | awk '{print $2}'

You should get a list showing above packages.

Run the following in a terminal to get rid of this,

sudo apt-get autoremove
sudo apt-get autoclean

To install gcc-4.8 and g++-4.8

sudo apt-get update
sudo apt-get install gcc-4.8 g++-4.8
Share:
5,431

Related videos on Youtube

Martin Drozdik
Author by

Martin Drozdik

Programmer, mathematician.

Updated on September 18, 2022

Comments

  • Martin Drozdik
    Martin Drozdik over 1 year

    I am trying to upgrade gcc-4.8.1 and g++-4.8.1 to 4.8.2. I added the PPA containing g++-4.8.2, ran apt-get update and then when I try:

    martin@martin-Studio-1537:~$ sudo apt-get upgrade
    [sudo] password for martin: 
    ...
    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
    0 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
    

    the packages I need to upgrade are kept back. When I try:

    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.
    

    the system wants to remove g++-4.8 gcc-4.8.

    When I try to install gcc-4.8 from Synaptic It wants to remove g++-4.8 and when I tell that it is ok to remove it, I get this error:

    enter image description here

    How can I install gcc-4.8.2 and g++-4.8.2?

    EDIT:

    As souravc suggested, I did

    martin@martin-Studio-1537:~$ dpkg -l | grep "^rc" | awk '{print $2}'
    

    and this is the result:

    autoconf
    bcmwl-kernel-source
    dkms
    lib64gcc1
    libbotan-1.10-0
    libc6-amd64
    libc6-x32
    libpcrecpp0:i386
    libqt5clucene5:i386
    libqt5declarative5:i386
    libqt5designer5:i386
    libqt5designercomponents5:i386
    libqt5help5:i386
    libqt5quickparticles5:i386
    libqt5quicktest5:i386
    libqt5script5:i386
    libsigsegv2:i386
    libx32gcc1
    libx32stdc++6
    linux-image-3.11.0-12-generic
    linux-image-3.11.0-15-generic
    linux-image-extra-3.11.0-12-generic
    linux-image-extra-3.11.0-15-generic
    usb-creator-gtk
    
    • Registered User
      Registered User about 10 years
    • Martin Drozdik
      Martin Drozdik about 10 years
      @adityapatil It is not a duplicate. I read that question and did not solve my problem. If you see the solution in one of the answers, could you please post it as the answer to this question?
    • Registered User
      Registered User about 10 years
      Have you tried all solutions? or at least those who are upvoted? Also read this.
    • Martin Drozdik
      Martin Drozdik about 10 years
      @adityapatil Those are not solutions to the problem I am solving.
    • Registered User
      Registered User about 10 years
      try installing thrugh terminal using the options -fm.
    • Martin Drozdik
      Martin Drozdik about 10 years
      @adityapatil Thank you, but the result is the same. The system wants to remove g++-4.8 gcc-4.8 in exchange for upgrading the 14 packages.
    • Registered User
      Registered User about 10 years
  • Martin Drozdik
    Martin Drozdik about 10 years
    Thank you, but I still get the same results. Moreover the list of packages I get (see my edit) is not the same as the ones I am trying to upgrade.
  • sourav c.
    sourav c. about 10 years
    @MartinDrozdik there was a typo. sorry for that. did you run those autoremove and autoclean commands? are you still getting the notice when going to apt-get update?
  • Martin Drozdik
    Martin Drozdik about 10 years
    Yes, I typed the commands without the typo and it still doesn't work
  • Avinash Raj
    Avinash Raj about 10 years
  • Registered User
    Registered User about 10 years
    For anyone needing explanation, read this discussion.
  • Braiam
    Braiam about 10 years
    Could you summarize the discussion instead and add it as answer?