I am having a problem when I run sudo apt-get dist-upgrade

I get this output:

    $ sudo apt-get dist-upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 libstdc++6 : Depends: gcc-5-base (= 5.4.0-6ubuntu1~16.04.4) but 5.4.1-2ubuntu1~14.04 is installed
              Breaks: libreoffice-core (<= 1:4.4.4~rc3-0ubuntu1) but 1:4.2.8-0ubuntu5.1 is installed
              Breaks: libstdc++6:i386 (!= 5.4.0-6ubuntu1~16.04.4) but 7.2.0-1ubuntu1~14.04 is installed
 libstdc++6:i386 : Breaks: libstdc++6 (!= 7.2.0-1ubuntu1~14.04) but 5.4.0-6ubuntu1~16.04.4 is installed
E: Unmet dependencies. Try using -f.

I have tried to do sudo apt-get -f install and I got this result:

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
3 not fully installed or removed.
Need to get 0 B/305 kB of archives.
After this operation, 501 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 370318 files and directories currently installed.)
Preparing to unpack .../libstdc++6_7.2.0-1ubuntu1~14.04_amd64.deb ...
Unpacking libstdc++6:amd64 (7.2.0-1ubuntu1~14.04) over (5.4.0-6ubuntu1~16.04.4) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_7.2.0-1ubuntu1~14.04_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/libstdc++6', which is different from other instances of package libstdc++6:amd64
Processing triggers for libc-bin (2.19-0ubuntu6.13) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I think I added a wrong ppa to my Linux Mint pointing to some Ubuntu stuff. Also, I might have installed a lib6stdc++ for i386 and not x64 architecture.

Short story: I am completely lost with this. Can you help me to sort this out?

Thank you in advance for your help :)

  • You should go to the Ask Ubuntu stackexchange for this. Stackoverflow is meant for programming specific questions and while you might get an answer "Ask Ubuntu" or the Linux/Unix exchange is better suited. Sep 5, 2017 at 13:29
  • @scrappedcola You're right :) I will move my question asap!
    – MrJay42
    Sep 5, 2017 at 13:38
  • @scrappedcola well apparently I can't remove my question here :(
    – MrJay42
    Sep 5, 2017 at 13:42
  • I think you can flag it for moderator attention and request migration Sep 5, 2017 at 14:10
  • @scrappedcola Not sur Mint questions are accepted on AskUbuntu since it's not an official Ubuntu distribution.
    – xhienne
    Sep 5, 2017 at 22:46

1 Answer 1


Correct libstdc++6 version is 5.4.0 on Ubuntu Xenial / Mint 18. Version 7.2 is being installed, and conflicts with what is already installed on your machine. That means that libstdc++6 is being fetched from an non-official Mint/Ubuntu repository.

First identify where it is coming from:

$ apt-cache policy libstdc++6
  Installed: 5.4.0-6ubuntu1~16.04.4
  Candidate: 5.4.0-6ubuntu1~16.04.4
  Version table:
 *** 5.4.0-6ubuntu1~16.04.4 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg/status
     5.3.1-14ubuntu2 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

apt-cache policy's output is briefly explained in this question. It gives you the different candidates, the installed version and the one that will be installed (the highest priority).

From this output, find out where the 7.2 version is being taken from and comment out the corresponding repository (you may also lower its priority if removing the repository is not an option for you -- man apt_preferences).

You must log in to answer this question.

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