When i try to install libstdc++ using:
sudo apt-get install libstdc++I am getting the below error in ubuntu. Do you have any idea about it?
The following packages have unmet dependencies: libstdc++-4.8-doc : Conflicts: libstdc++6-4.4-doc but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-doc but 4.6.4-6ubuntu2 is to be installed Conflicts: libstdc++6-4.7-doc but 4.7.3-12ubuntu1 is to be installed libstdc++-4.9-doc : Conflicts: libstdc++-4.8-doc but 4.8.5-2ubuntu1~14.04.1 is to be installed Conflicts: libstdc++6-4.4-doc but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-doc but 4.6.4-6ubuntu2 is to be installed Conflicts: libstdc++6-4.7-doc but 4.7.3-12ubuntu1 is to be installed libstdc++-5-doc : Conflicts: libstdc++-4.8-doc but 4.8.5-2ubuntu1~14.04.1 is to be installed Conflicts: libstdc++-4.9-doc but 4.9.3-8ubuntu2~14.04 is to be installed Conflicts: libstdc++6-4.4-doc but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-doc but 4.6.4-6ubuntu2 is to be installed Conflicts: libstdc++6-4.7-doc but 4.7.3-12ubuntu1 is to be installed libstdc++6-4.6-dbg : Conflicts: libstdc++6-4.4-dbg but 4.4.7-8ubuntu1 is to be installed libstdc++6-4.6-doc : Conflicts: libstdc++6-4.4-doc but 4.4.7-8ubuntu1 is to be installed libstdc++6-4.7-dbg : Conflicts: libstdc++6-4.4-dbg but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-dbg but 4.6.4-6ubuntu2 is to be installed libstdc++6-4.7-doc : Conflicts: libstdc++6-4.4-doc but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-doc but 4.6.4-6ubuntu2 is to be installed libstdc++6-4.8-dbg : Conflicts: libstdc++6-4.4-dbg but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-dbg but 4.6.4-6ubuntu2 is to be installed Conflicts: libstdc++6-4.7-dbg but 4.7.3-12ubuntu1 is to be installed libstdc++6-4.8-dbg-armhf-cross : Conflicts: libstdc++6-4.7-dbg-armhf-cross but 4.7.3-11ubuntu1cross1.85 is to be installed libstdc++6-4.9-dbg : Conflicts: libstdc++6-4.4-dbg but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-dbg but 4.6.4-6ubuntu2 is to be installed Conflicts: libstdc++6-4.7-dbg but 4.7.3-12ubuntu1 is to be installed Conflicts: libstdc++6-4.8-dbg but 4.8.5-2ubuntu1~14.04.1 is to be installed libstdc++6-5-dbg : Conflicts: libstdc++6-4.4-dbg but 4.4.7-8ubuntu1 is to be installed Conflicts: libstdc++6-4.6-dbg but 4.6.4-6ubuntu2 is to be installed Conflicts: libstdc++6-4.7-dbg but 4.7.3-12ubuntu1 is to be installed Conflicts: libstdc++6-4.8-dbg but 4.8.5-2ubuntu1~14.04.1 is to be installed Conflicts: libstdc++6-4.9-dbg but 4.9.3-8ubuntu2~14.04 is to be installed
E: Unable to correct problems, you have held broken packages. 3 3 Answers
There isn't actually a package called libstdc++ (possibly you are trying to install libstdc++6?)
When apt doesn't find an exact match to a package name, it treats the given string as a regular expression. In this case the ++ causes it to try to install any package whose name matches libstd followed by one or more c - many of which conflict, as you can see.
Unfortunately I have never managed to figure out how to turn off this behaviour (nothing I have tried in the past using escape characters has seemed to work) - the only solution I know is to be careful to give an exact package name where any regex characters might be misinterpreted, and to make sure the package catalog is up-to-date i.e.
sudo apt-get update
sudo apt-get install libstdc++6 1 First run these commands
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential
sudo apt-get install aptitudeand then try
sudo apt-get install libstdc++6or try this search result and install one desired package from listed
4LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9 1