sudo apt-get instala libstdc ++

8

Quando tento instalar libstdc++ usando:

sudo apt-get install libstdc++

Estou recebendo o erro abaixo no Ubuntu. Você tem alguma ideia sobre isso?

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.
    
por user2856923 28.01.2016 / 07:06

3 respostas

10

Primeiro, execute estes comandos

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential
sudo apt-get install aptitude

e tente

sudo apt-get install libstdc++6

ou tente este resultado de pesquisa e instale um pacote desejado do link

listado     
por M A K Ripon 28.01.2016 / 07:30
7

Na verdade, não existe um pacote chamado libstdc++ (possivelmente você está tentando instalar o libstdc++6 ?)

Quando o apt não encontra uma correspondência exata para um nome de pacote, ele trata a string dada como uma expressão regular. Nesse caso, o ++ faz com que ele tente instalar qualquer pacote cujo nome corresponda a libstd seguido por um ou mais c - muitos dos quais entram em conflito, como você pode ver.

Infelizmente eu nunca consegui descobrir como desativar esse comportamento (nada que eu tenha tentado no passado usando caracteres de escape pareceu funcionar) - a única solução que eu sei é ter cuidado para dar um nome de pacote exato onde qualquer caractere regex pode ser mal interpretado e garantir que o catálogo de pacotes esteja atualizado, ou seja,

sudo apt-get update
sudo apt-get install libstdc++6
    
por steeldriver 28.01.2016 / 18:35
2
LD_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
    
por Venkat Kotra 22.10.2016 / 05:36

Tags