GNU/Linux >> Tutoriales Linux >  >> Ubuntu

¿No se puede instalar Python-dev en Ubuntu 16.04 Lts usando Aptitude y Apt-get?

Estoy tratando de instalar python-dev en un invitado de Ubuntu 16.04 LTS (64 bits) que se ejecuta en un host de Windows. Intenté instalar usando apt-get y luego a través de aptitude, pero parece que me encuentro con errores.

~$sudo aptitude install python-dev

da,

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/?] 

como salida. Considerando que,

~$sudo apt-get install python-dev

da,

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.

Ejecuté sudo aptitude update y sudo aptitude upgrade , pero eso no resuelve el problema.

Además, ejecuté los pasos dados en los siguientes enlaces:

  • No se puede instalar python-dev
  • ¿Cómo resuelvo las dependencias no satisfechas después de agregar un PPA?

pero nada parece funcionar.

Del mensaje de aptitude, creo que las dependencias instaladas en mi sistema son de una versión superior a la requerida por el paquete (por ejemplo, un mensaje dice Depends: libpython2.7 (= 2.7.11-7ubuntu1) but 2.7.12-1~16.04 is installed. ).

Supongo que mis opciones son,

  • desinstalar los paquetes existentes (que preferiría no hacerlo), o
  • agregue un PPA más actualizado para Python-stuff.
Relacionado:No se puede instalar Java JDK en Ubuntu 12.04:¿Paquetes rotos?

Mis repositorios actuales son:

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

¿Alguna idea de cómo puedo instalar python-dev?

¡Gracias de antemano!

Respuesta aceptada:

Una de mis nuevas instalaciones tiene estos repositorios. Parece que te falta alguna update repositorios.

Coloqué * estrellas en las que no veo en tu lista.

[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]:~$ 

Intenta al menos agregar la update repositorios... luego ejecute:

$ sudo apt update
$ sudo apt upgrade

Ubuntu
  1. Instalación de Java en Ubuntu usando Apt-get

  2. Cómo instalar y usar iostat en Ubuntu 16.04 LTS

  3. Cómo instalar y configurar Ansible en Ubuntu 18.04 LTS

  4. Cómo instalar Libreoffice 4.3 en Ubuntu 12.04 y 14.04 LTS

  5. Cómo instalar Libreoffice 4.4 en Ubuntu 15.04 y 14.04 LTS

Instale e implemente Kubernetes en Ubuntu 18.04 LTS

Cómo instalar PHP 5.6, PHP 8.0 y PHP 8.1 en Ubuntu 20.04 LTS

Cómo instalar uTorrent en Ubuntu 16.04 LTS y Ubuntu 17.10

Cómo instalar y usar Jenkins en Ubuntu 18.04 y 16.04 LTS

Instale phpMyAdmin en Ubuntu 22.04 | 20.04 LTS usando repositorio

Cómo instalar JuliaLang en Ubuntu 16.04 LTS