web-dev-qa-db-fra.com

Impossible d'installer python-dev à cause des dépendances sur Ubuntu 16.04

Comment puis-je résoudre ce problème (sans endommager mon ordinateur!)? Je veux installer python-dev sur mon Ubuntu. J'ai déjà essayé aptitude, ça n'a pas été utile.

$ 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.

Supplémentaire:

$ 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
2
Milad

On dirait que vous n'avez pas de référentiel important dans votre sources.list activé.

Ajouter cette ligne:

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

sur /etc/apt/sources.list, puis utilisez Sudo apt update.

ça devrait faire l'affaire.

6
Ravexina