1

I recently upgraded my server from Ubuntu 12.04 to 14.10. I had installed GCC 4.9 (4.9.2 apparently) before the upgrade and today I wanted to install gcc-4.9-multilib, but apt-get gave me:

gcc-4.9-multilib : Depends: gcc-4.9 (= 4.9.1-16ubuntu6) but 4.9.2-0ubuntu1~12.04 is to be installed

So I removed gcc-4.9 and wanted to reinstall it, but the same game happens with gcc-4.9-base:

 gcc-4.9 : Depends: cpp-4.9 (= 4.9.1-16ubuntu6) but 4.9.2-0ubuntu1~12.04 is to be installed
           Depends: gcc-4.9-base (= 4.9.1-16ubuntu6) but 4.9.2-0ubuntu1~12.04 is to be installed

cpp-4.9 I could remove, but removing gcc-4.9-base would leave not much more than the kernel behind I guess...

[ Too long, click for paste ]

I also tried using aptitude to remove 4.9.2-0ubuntu1~12.04 and installing 4.9.1-16ubuntu6, but when I try to apply the selected changes, it gives me:

Some packages were broken and have been fixed:
Keep the following packages at their current version:
gcc-4.9-base [4.9.2-0ubuntu1~12.04 (now)]

So how do I get rid of that 12.04 stuff without removing my entire operating system?

Edit:

My sources:

bash$ cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list
deb http://archive.ubuntu.com/ubuntu utopic main
deb http://archive.ubuntu.com/ubuntu utopic-updates main
deb http://security.ubuntu.com/ubuntu utopic-security main universe restricted
deb http://archive.ubuntu.com/ubuntu utopic universe restricted
deb http://archive.ubuntu.com/ubuntu utopic-updates universe restricted
deb http://pkg.jenkins-ci.org/debian binary/
# deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu utopic main
# deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu utopic main

Trying to fix anything broken:

bash$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Policy info:

bash$ apt-cache policy gcc-4.9
gcc-4.9:
  Installed: (none)
  Candidate: 4.9.1-16ubuntu6
  Version table:
     4.9.1-16ubuntu6 0
        500 http://archive.ubuntu.com/ubuntu/ utopic/main amd64 Packages

Trying to install gcc-4.9:

bash$ sudo apt-get install gcc-4.9
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:
 gcc-4.9 : Depends: cpp-4.9 (= 4.9.1-16ubuntu6) but it is not going to be installed
           Depends: gcc-4.9-base (= 4.9.1-16ubuntu6) but 4.9.2-0ubuntu1~12.04 is to be installed
E: Unable to correct problems, you have held broken packages.

Trying to install gcc-4.9-base=4.9.1-16ubuntu6:

[ Too long, click for paste ]

Trying to upgrade Ubuntu:

bash$ sudo do-release-upgrade
Checking for a new Ubuntu release
No new release found

And I'm not on LTS:

bash$ cat /etc/update-manager/release-upgrades
# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
#  never  - Never check for a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the release that immediately succeeds the currently-running
#           release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that this option should not be
#           used if the currently-running release is not itself an LTS
#           release, since in that case the upgrader won't be able to
#           determine if a newer release is available.
Prompt=normal

Update:

bash$ sudo apt-get update
Ign http://archive.ubuntu.com utopic InRelease
Ign http://security.ubuntu.com utopic-security InRelease
Ign http://archive.ubuntu.com utopic-updates InRelease
Get:1 http://security.ubuntu.com utopic-security Release.gpg [933 B]
Hit http://archive.ubuntu.com utopic Release.gpg
Get:2 http://security.ubuntu.com utopic-security Release [62.0 kB]
Get:3 http://archive.ubuntu.com utopic-updates Release.gpg [933 B]
Ign http://pkg.jenkins-ci.org binary/ InRelease
Hit http://archive.ubuntu.com utopic Release
Get:4 http://archive.ubuntu.com utopic-updates Release [62.0 kB]
Get:5 http://security.ubuntu.com utopic-security/main amd64 Packages [110 kB]
Hit http://pkg.jenkins-ci.org binary/ Release.gpg
Get:6 http://security.ubuntu.com utopic-security/universe amd64 Packages [46.6 kB]
Hit http://pkg.jenkins-ci.org binary/ Release
Get:7 http://security.ubuntu.com utopic-security/restricted amd64 Packages [8,496 B]
Hit http://archive.ubuntu.com utopic/main amd64 Packages
Get:8 http://security.ubuntu.com utopic-security/main i386 Packages [109 kB]
Hit http://pkg.jenkins-ci.org binary/ Packages
Hit http://archive.ubuntu.com utopic/universe amd64 Packages
Get:9 http://security.ubuntu.com utopic-security/universe i386 Packages [46.5 kB]
Hit http://archive.ubuntu.com utopic/restricted amd64 Packages
Get:10 http://security.ubuntu.com utopic-security/restricted i386 Packages [8,438 B]
Hit http://archive.ubuntu.com utopic/main i386 Packages
Get:11 http://security.ubuntu.com utopic-security/main Translation-en [52.8 kB]
Hit http://archive.ubuntu.com utopic/universe i386 Packages
Hit http://security.ubuntu.com utopic-security/restricted Translation-en
Hit http://archive.ubuntu.com utopic/restricted i386 Packages
Hit http://archive.ubuntu.com utopic/main Translation-en
Get:12 http://security.ubuntu.com utopic-security/universe Translation-en [25.7 kB]
Hit http://archive.ubuntu.com utopic/main Translation-en_GB
Hit http://archive.ubuntu.com utopic/restricted Translation-en
Hit http://archive.ubuntu.com utopic/restricted Translation-en_GB
Hit http://archive.ubuntu.com utopic/universe Translation-en
Hit http://archive.ubuntu.com utopic/universe Translation-en_GB
Get:13 http://archive.ubuntu.com utopic-updates/main amd64 Packages [162 kB]
Get:14 http://archive.ubuntu.com utopic-updates/universe amd64 Packages [63.3 kB]
Get:15 http://archive.ubuntu.com utopic-updates/restricted amd64 Packages [8,496 B]
Get:16 http://archive.ubuntu.com utopic-updates/main i386 Packages [160 kB]
Ign http://pkg.jenkins-ci.org binary/ Translation-en_US
Ign http://pkg.jenkins-ci.org binary/ Translation-en
Get:17 http://archive.ubuntu.com utopic-updates/universe i386 Packages [63.2 kB]
Ign http://pkg.jenkins-ci.org binary/ Translation-en_GB
Get:18 http://archive.ubuntu.com utopic-updates/restricted i386 Packages [8,438 B]
Get:19 http://archive.ubuntu.com utopic-updates/main Translation-en [74.2 kB]
Hit http://archive.ubuntu.com utopic-updates/restricted Translation-en
Get:20 http://archive.ubuntu.com utopic-updates/universe Translation-en [35.2 kB]
Fetched 1,108 kB in 5s (216 kB/s)
Reading package lists... Done

Upgrade:

bash$ sudo apt-get 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.

Dist-upgrade:

bash$ sudo apt-get dist-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.

And something I stumbled across:

bash$ apt list -a gcc-4.9-base
Listing... Done
gcc-4.9-base/now 4.9.2-0ubuntu1~12.04 amd64 [installed,local]
gcc-4.9-base/utopic 4.9.1-16ubuntu6 amd64
Siguza
  • 111

1 Answers1

0

I had the same problem. I tried downgrading all of the gcc packages without success because apt-get couldn't find the right version of libgcc1, although apt-cache told me it did know it:

$ sudo apt-get install  libgcc1=4.9.1-16ubuntu6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '4.9.1-16ubuntu6' for 'libgcc1' was not found

I downloaded libgcc1_4.9.1-16ubuntu6_i386.deb and /var/cache/apt/archives/libgcc1_4.9.1-16ubuntu6_amd64.deb manually from the website, and was able to downgrade with this command:

sudo aptitude install gcc-4.9-base=4.9.1-16ubuntu6 gcc-4.9=4.9.1-16ubuntu6 \
libasan1=4.9.1-16ubuntu6 libquadmath0=4.9.1-16ubuntu6 lib32gcc1=4.9.1-16ubuntu6 \ 
lib32stdc++6=4.9.1-16ubuntu6 libubsan0=4.9.1-16ubuntu6 cpp-4.9=4.9.1-16ubuntu6 \ 
libgomp1=4.9.1-16ubuntu6 libtsan0=4.9.1-16ubuntu6 libx32asan1=4.9.1-16ubuntu6 \
libcilkrts5=4.9.1-16ubuntu6 lib32ubsan0=4.9.1-16ubuntu6 libx32itm1=4.9.1-16ubuntu6 \ 
libx32gcc-4.9-dev=4.9.1-16ubuntu6 libgcc1=4.9.1-16ubuntu6 \ 
lib32gcc-4.9-dev=4.9.1-16ubuntu6 libx32gomp1=4.9.1-16ubuntu6 \ 
libx32atomic1=4.9.1-16ubuntu6 libobjc4=4.9.1-16ubuntu6 \
libx32cilkrts5=4.9.1-16ubuntu6 libatomic1=4.9.1-16ubuntu6 \
lib32asan1=4.9.1-16ubuntu6 gcc-4.9-multilib=4.9.1-16ubuntu6 \
lib32cilkrts5=4.9.1-16ubuntu6 gcc-4.9=4.9.1-16ubuntu6 \
libx32quadmath0=4.9.1-16ubuntu6 lib32gomp1=4.9.1-16ubuntu6 \
lib32atomic1=4.9.1-16ubuntu6 lib32itm1=4.9.1-16ubuntu6 \
libx32gcc1=4.9.1-16ubuntu6 libgfortran3=4.9.1-16ubuntu6 \
libgcc-4.9-dev=4.9.1-16ubuntu6 liblsan0=4.9.1-16ubuntu6 \
libstdc++6=4.9.1-16ubuntu6 lib32quadmath0=4.9.1-16ubuntu6 \
libitm1=4.9.1-16ubuntu6 gcc-4.9-base=4.9.1-16ubuntu6 \
gcc-4.9-base:i386=4.9.1-16ubuntu6 libx32ubsan0=4.9.1-16ubuntu6 \ 
libstdc++6:i386=4.9.1-16ubuntu6 \
/path/to/libgcc1_4.9.1-16ubuntu6_amd64.deb \
/path/to/libgcc1_4.9.1-16ubuntu6_i386.deb

You may need fewer entries there - if apt tells you it's going to install 'new' packages, rather than downgrading existing ones, you might be able to remove those ones.

steveire
  • 101
  • 1