I have a dependency loop that I cannot figure out how to get around and it is keeping me from upgrading.
I am currently on 14.04 and want to move to 16.04. Further below is a showing of what I have been trying, unsuccessfully. And at any point through the workings, if I do the apt-get -f install, then the whole mess is right back at the start of the problem.
But firstly, let me shortcut to the specific question and then if you want to know the why and how of the question, see below.
QUESTION: How can I move the package gcc-4.8-base from version 14.04.3 to 14.04.1? Just simply giving the desired version is not enough, the older package doesn't exist on my machine and I have no idea where and how to get that older package.
This is how I have arrived at needing to answer the above question and if you see a different solution to the problem, I am all ears (eyes at it were):
sudo apt-get update
This works fine. Then upgrade:
sudo apt-get upgrade
This fails with:
The following packages have unmet dependencies:
libstdc++-4.8-dev : Depends: libstdc++6 (>= 4.8.4-2ubuntu1~14.04.3) but 4.8.4-2ubuntu1~14.04.1 is installed
libstdc++6 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04.1) but 4.8.4-2ubuntu1~14.04.3 is installed
E: Unmet dependencies. Try using -f.
So as suggested try with the -f option:
sudo apt-get upgrade -f
And after several minutes of fetching finally fails with:
Preparing to unpack .../libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb ...
Unpacking libstdc++6:i386 (4.8.4-2ubuntu1~14.04.3) over (4.8.4-2ubuntu1~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb (--unpack):
trying to overwrite '/usr/share/gcc-4.8/python/libstdcxx/__init__.py', which is also in package libstdc++6-armhf-cross 4.8.4-2ubuntu1~14.04.1cross0.11.1
Errors were encountered while processing:
/var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
My thought at this point is get rid of libstdc++6-armhf-cross, I don't currently need to do any cross-compiling and in the future, if I do, I'll look at bringing it back in:
sudo apt-get remove --purge libstdc++6-armhf-cross libstdc++-4.8-dev-armhf-cross g++-4.8-arm-linux-gnueabihf libsfstdc++-4.8-dev-armhf-cross g++-4.8-multilib-arm-linux-gnueabihf libstdc++-4.8-dev g++-4.8 g++-arm-linux-gnueabihf g++ build-essential
This runs fine and so back to the upgrade:
sudo apt-get upgrade
Well, it still fails, only this time on a different package:
The following packages have unmet dependencies:
libstdc++-4.8-dev : Depends: libstdc++6 (>= 4.8.4-2ubuntu1~14.04.3) but 4.8.4-2ubuntu1~14.04.1 is installed
libstdc++6 : Depends: gcc-4.8-base (= 4.8.4-2ubuntu1~14.04.1) but 4.8.4-2ubuntu1~14.04.3 is installed
E: Unmet dependencies. Try using -f.
And using the -f option:
sudo apt-get upgrade -f
Fails again with:
Preparing to unpack .../libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb ...
Unpacking libstdc++6:i386 (4.8.4-2ubuntu1~14.04.3) over (4.8.4-2ubuntu1~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb (--unpack):
trying to overwrite '/usr/share/gcc-4.8/python/libstdcxx/__init__.py', which is also in package libstdc++6-armhf-cross 4.8.4-2ubuntu1~14.04.1cross0.11.1
Errors were encountered while processing:
/var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
So, get rid of gcc-4.8-base? Nope, that ain't happening, it is a dependency to libstdc++6, hence the circular dependency. The only solution I can think of is trying to move gcc-4.8-base back to version 14.03.1 and then upgrading from there, hence the original question above.
As per suggestion from Scott, I also began to try his sequence but the very first command failed:
sudo dpkg --configure -a
Failed with:
dpkg: dependency problems prevent configuration of libstdc++-4.8-dev:i386:
libstdc++-4.8-dev:i386 depends on libstdc++6 (>= 4.8.4-2ubuntu1~14.04.3); however:
Version of libstdc++6:i386 on system is 4.8.4-2ubuntu1~14.04.1.
dpkg: error processing package libstdc++-4.8-dev:i386 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of g++-4.8:
g++-4.8 depends on libstdc++-4.8-dev (= 4.8.4-2ubuntu1~14.04.3); however:
Package libstdc++-4.8-dev:i386 is not configured yet.
dpkg: error processing package g++-4.8 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libstdc++-4.8-dev:i386
g++-4.8
{}
button in the editor rather than backticks. – Chai T. Rex Dec 15 '16 at 05:39