Não é possível instalar o python2.7-dev no Ubuntu 12.04.2 LTS

3

O comando $ sudo apt-get install python2.7-dev produz este resultado:

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:
 python2.7-dev : Depends: libexpat1-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Eu executei sudo apt-get update , sudo apt-get upgrade e sudo apt-get dist-upgrade antes de executar o comando de instalação. Eu tentei mudar o servidor de repositório do meu servidor local (República Checa) para o servidor principal. Eu tentei instalar o pacote usando o aptitude, o resultado foi:

The following NEW packages will be installed:
  libexpat1-dev{ab} libssl-dev{a} libssl-doc{a} python2.7-dev 
0 packages upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 32.4 MB of archives. After unpacking 47.9 MB will be used.
The following packages have unmet dependencies:
 libexpat1-dev : Depends: libexpat1 (= 2.0.1-7.2ubuntu1.1) but 2.1.0-1ubuntu1 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libexpat1-dev [Not Installed]                      
2)     python2.7-dev [Not Installed]                      



Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

A "solução" sugerida pelo aptitude não faz nada e não tem efeito. Depois de imprimir o acima, ele existe sem um código de erro ou qualquer mensagem de erro.

Eu tentei remover libexpat1, mas muitos pacotes que eu preciso dependem dele, incluindo, parece, um grande pedaço de gnome.

Nenhuma das coisas que tentei teve algum efeito, o resultado do comando de instalação ainda era o mesmo.

Eu pesquisei na web sobre o assunto e encontrei algumas postagens que pareciam estar relacionadas ao meu problema, mas embora possam ser "resolvidas", nenhuma delas me ajudou de alguma forma (aqui estão as duas que eu não fiz fechar antes de fazer esta pergunta):

  1. Não é possível instalar python2.7-dev devido a dependências não satisfeitas Ubuntu 12.04
  2. link
por Honza 23.06.2013 / 10:37

1 resposta

2

A parte interessante aqui é:

libexpat1-dev : Depends: libexpat1 (= 2.0.1-7.2ubuntu1.1) but 2.1.0-1ubuntu1 is installed.

De acordo com a ferramenta de pesquisa de pacotes online , 12.04 LTS envia libexpat1 versão 2.0.1-7.2ubuntu1.1 para ambos precise e precise-updates . A questão é, como você obteve a versão 2.1.0-1ubuntu1 instalada em primeiro lugar?

Usando a interface do usuário interativa aptitude() , você pode pesquisar por libexpat1 e selecionar a versão apropriada para instalação, ou seja, fazer downgrade do pacote para corresponder à dependência libexpat1-dev .

Você também pode fazer isso a partir da linha de comando:

sudo aptitude install package=version
    
por 23.06.2013 / 11:50