Após a atualização para o Ubuntu 18.04 build-essential, g ++, gcc e cpp continham pacotes quebrados

3

Após a atualização para o Ubuntu 18.04 a partir de 16.04 build-essential, g ++, gcc & cpp E: Unable to correct problems, you have held broken packages.

$ sudo apt-get install build-essential
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:
 build-essential : Depends: gcc (>= 4:7.2) but it is not going to be installed
                   Depends: g++ (>= 4:7.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


$ sudo apt-get install gcc
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 : Depends: gcc-7 (>= 7.3.0-12~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

O mesmo tipo de saída para g ++ & cpp

Como consertar isso?

    
por Santhosh Veer 27.04.2018 / 16:43

2 respostas

1

Encontrei o mesmo - no Ubuntu 16.04 eu tinha o Teste de construção de toolchain PPA para compilações gcc e clang, incluindo gcc-7 . Durante a atualização para o 18.04, os repositórios de terceiros foram desativados pelo processo de instalação, com este PPA incluído.

Para corrigir isso, tente (re) adicionar o PPA de toolchain à sua lista de fontes do apt:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

Em seguida, ao instalar o build-essential , ele deve selecionar com sucesso gcc-7 do PPA da cadeia de ferramentas.

    
por valiano 28.04.2018 / 20:49
0

Eu tive o mesmo problema, mas aparentemente eu usei um PPA diferente quando instalei essas ferramentas.

Para mim, consertei:

sudo add-apt-repository ppa:jonathonf/gcc
    
por Duncan Jones 17.09.2018 / 10:20