Não é possível instalar o python-dev por causa das dependências no Ubuntu 16.04

2

Como posso resolver esse problema (sem danificar meu computador!)? Eu quero instalar o python-dev no meu Ubuntu. Eu já tentei aptitude , não foi útil.

$ sudo apt-get install libexpat1-dev libpython-dev libpython2.7-dev python-dev  

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:
 libexpat1-dev : Depends: libexpat1 (= 2.1.0-7) but 2.1.0-7ubuntu0.16.04.2 is to be installed
 libpython2.7-dev : Depends: libpython2.7-stdlib (= 2.7.11-7ubuntu1) but 2.7.12-1ubuntu0~16.04.1 is to be installed
                    Depends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1ubuntu0~16.04.1 is to be installed
 python-dev : Depends: python2.7-dev (>= 2.7.11-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Extra:

$ apt policy libexpat1-dev
libexpat1-dev:
  Installed: (none)
  Candidate: 2.1.0-7
  Version table:
     2.1.0-7 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
$ grep "^deb " /etc/apt/sources.li
st
deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.canonical.com/ubuntu xenial partner
$ apt policy python2.7-dev
python2.7-dev:
  Installed: (none)
  Candidate: 2.7.11-7ubuntu1
  Version table:
     2.7.11-7ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
    
por Milad 05.06.2017 / 12:48

1 resposta

3

Parece que você não tem um repositório importante em sources.list ativado.

Adicione esta linha:

deb http://archive.ubuntu.com/ubuntu/ xenial-updates main universe multiverse

para /etc/apt/sources.list e, em seguida, use sudo apt update .

deve fazer o truque.

    
por Ravexina 05.06.2017 / 13:50