GNU/Linux >> Tutoriels Linux >  >> Ubuntu

Impossible d'installer Python-dev sur Ubuntu 16.04 Lts en utilisant Aptitude et Apt-get ?

J'essaie d'installer python-dev sur un invité Ubuntu 16.04 LTS (64 bits) exécuté sur un hôte Windows. J'ai essayé d'installer en utilisant apt-get puis via aptitude, mais il semble que je rencontre des erreurs.

~$sudo aptitude install python-dev

donne,

The following NEW packages will be installed:
  libexpat1-dev{ab} libpython-dev{a} libpython2.7-dev{ab} python-dev python2.7-dev{ab} 
0 packages upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 28.2 MB of archives. After unpacking 42.1 MB will be used.
The following packages have unmet dependencies:
 python2.7-dev : Depends: python2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
                 Depends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
 libexpat1-dev : Depends: libexpat1 (= 2.1.0-7) but 2.1.0-7ubuntu0.16.04.2 is installed.
 libpython2.7-dev : Depends: libpython2.7-stdlib (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
                    Depends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed.
open: 20; closed: 1293; defer: 6; conflict: 6                                                                  o
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libexpat1-dev [Not Installed]                      
2)     libpython-dev [Not Installed]                      
3)     libpython2.7-dev [Not Installed]                   
4)     python-dev [Not Installed]                         
5)     python2.7-dev [Not Installed]                      



Accept this solution? [Y/n/q/?] 

comme sortie. Attendu que,

~$sudo apt-get install python-dev

donne,

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:
 python-dev : Depends: libpython-dev (= 2.7.11-1) but it is not going to be installed
              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.

J'ai lancé sudo aptitude update et sudo aptitude upgrade , mais cela ne résout pas le problème.

De plus, j'ai exécuté les étapes indiquées dans les liens suivants :

  • Impossible d'installer python-dev
  • Comment puis-je résoudre les dépendances non satisfaites après avoir ajouté un PPA ?

mais rien ne semble fonctionner.

D'après le message d'aptitude, je pense que les dépendances installées sur mon système sont d'une version supérieure à ce qui est requis par le paquet (par exemple, un message ditDepends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed. ).

Je suppose que mes options sont soit de,

  • désinstaller les packages existants (ce que je préfère ne pas), ou
  • ajouter un PPA plus mis à jour pour Python-stuff.
Connexe :Impossible d'installer Java JDK dans Ubuntu 12.04 :Paquets cassés ?

Mes référentiels actuels sont :

~$egrep -v '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse

Des idées sur la façon dont je peux installer python-dev ?

Merci d'avance !

Réponse acceptée :

Une de mes nouvelles installations a ces référentiels. Il semble qu'il vous manque une update référentiels.

J'ai placé * étoiles à celles que je ne vois pas dans votre liste.

[email protected]:~$ egrep -v '^#|^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
/etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
* /etc/apt/sources.list:deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
* /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security main restricted
* /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security universe
* /etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security multiverse
grep: /etc/apt/sources.list.d/*: No such file or directory
[email protected]:~$ 

Essayez au moins d'ajouter la update référentiels… puis exécutez :

$ sudo apt update
$ sudo apt upgrade

Ubuntu
  1. Installer Java sur Ubuntu avec Apt-get

  2. Comment installer et utiliser iostat sur Ubuntu 16.04 LTS

  3. Comment installer et configurer Ansible sur Ubuntu 18.04 LTS

  4. Comment installer Libreoffice 4.3 sur Ubuntu 12.04 et 14.04 LTS

  5. Utiliser Ansible pour installer et configurer Elasticsearch sur Ubuntu 20.04

Installer et déployer Kubernetes sur Ubuntu 18.04 LTS

Comment installer PHP 5.6, PHP 8.0 et PHP 8.1 sur Ubuntu 20.04 LTS

Comment installer uTorrent dans Ubuntu 16.04 LTS et Ubuntu 17.10

Comment installer et utiliser Jenkins sur Ubuntu 18.04 et 16.04 LTS

Installez phpMyAdmin sur Ubuntu 22.04 | 20.04 LTS utilisant le référentiel

Comment installer JuliaLang sur Ubuntu 16.04 LTS