ubuntu - apt - E: No se pueden corregir los problemas, tiene paquetes rotos

CorePress2023-09-17  1

Estoy usando Ubuntu 13.04 que instalé hace unos días. Estoy intentando instalar nodejs y npm. Primero intenté instalar desde la línea de comandos y luego lo desinstalé. Entonces algo se rompió.

sudo apt-get install -f nodejs npm
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:
 nodejs : Conflicts: npm
E: Unable to correct problems, you have held broken packages.

La salida de /etc/apt/sources.list se encuentra a continuación:

# deb cdrom:[Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424)]/ raring main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ raring main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ raring main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ raring-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ raring-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ raring universe
deb-src http://in.archive.ubuntu.com/ubuntu/ raring universe
deb http://in.archive.ubuntu.com/ubuntu/ raring-updates universe
deb-src http://in.archive.ubuntu.com/ubuntu/ raring-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ raring multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ raring multiverse
deb http://in.archive.ubuntu.com/ubuntu/ raring-updates multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ raring-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu raring-security main restricted
deb-src http://security.ubuntu.com/ubuntu raring-security main restricted
deb http://security.ubuntu.com/ubuntu raring-security universe
deb-src http://security.ubuntu.com/ubuntu raring-security universe
deb http://security.ubuntu.com/ubuntu raring-security multiverse
deb-src http://security.ubuntu.com/ubuntu raring-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu raring partner
# deb-src http://archive.canonical.com/ubuntu raring partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu raring main
deb-src http://extras.ubuntu.com/ubuntu raring main

La salida de /etc/apt/sources.list.d/* está a continuación:

deb http://ppa.launchpad.net/chris-lea/node.js/ubuntu raring main
# deb-src http://ppa.launchpad.net/chris-lea/node.js/ubuntu raring main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/chrome/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/chrome/deb/ stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://deb.opera.com/opera/ stable non-free
deb http://deb.opera.com/opera/ stable non-free
deb http://deb.opera.com/opera/ stable non-free
deb http://deb.opera.com/opera/ stable non-free
  • 1 No estoy seguro de cuál es la pregunta, sin embargo, esto puede ayudarle. Vaya al administrador de paquetes synaptic. Editar > Reparar paquetes rotos. -danijelc 21 de octubre de 2013 a las 17:15
  • cuando hago 'gksudo synaptic' no pasa nada - John Qualis 21 de octubre de 2013 a las 17:17
  • 2 Primero debes instalarlo sudo apt-get update sudo apt-get update sudo apt-get install synaptic -danijelc 21 de octubre de 2013 a las 17:20
  • Otra forma de obtener un error similar (aunque aparentemente no para el OP) es configurar APT::Default-Release. Si eso requiere que se instale un paquete desde una versión anterior a las dependencias que ya están presentes, es posible que sean incompatibles, lo que generará el mismo error. Poolie 15 de diciembre de 2013 a las 19:09
  • 1 ¿Esto responde a tu pregunta? No se pueden corregir los problemas, tiene paquetes rotos -Melebio 19 de febrero de 2020 a las 10:23


------------Respuesta------------

Utilice aptitude en lugar de apt-get. Es más inteligente. No solo se encargará de degradar los paquetes conflictivos por usted, sino que también hará una serie de recomendaciones preguntándole cuál de los muchos posibles escenarios de trabajo sugeridos le gustaría.

sudo aptitude install myNewPackage

Si aún no tienes aptitude en tu máquina, consíguelo con

sudo apt-get install aptitude

  • 48 La mejor respuesta. Probé apt-get durante los últimos días. Con aptitude esto se solucionó en segundos :-)- Johan Karlsson 4 de septiembre de 2014 a las 10:58
  • 8 Gracias. He pasado tanto tiempo leyendo diferentes formas de solucionar el problema que apt-get won'No puedo explicar que me sorprendió cuando aptitude simplemente presentó el problema específico e incluso proporcionó una solución. -bmacnaughton 29 de abril de 2015 a las 0:54
  • 8 La única desventaja de esta solución: no puedes hacer sudo apt-get install aptitude si tus paquetes no funcionan. - usuario13161 15 de marzo de 2017 a las 20:08
  • 1¡¡Muchas gracias!! ¡Trabajó para mi! Pude salir de la retención (apt-get) durante más de dos días. ¡La aptitud es realmente inteligente! [Ubuntu MATE 18.04.1 LTS, Kernel Linux 4.15.0-45-generic x86_64, MATE 1.20.1] - ADEBISI Foluso A. 5 de febrero de 2019 a las 15:23
  • 2 ¡Guau! ¡La aptitud es genial! Tuvo varios problemas con mi instalación y configuración de mysql. afortunadamente, se resolvió solo eliminando un montón de dependencias malas. - hoy 8 de agosto de 2019 a las 14:59


------------Respuesta------------

Deberías poder ver la lista de paquetes retenidos mediante:

apt-mark showhold 

y luego suéltelos mediante

sudo apt-mark unhold <package name>

Después de eso, deberías poder eliminar el paquete conflictivo (parece ser npm) y luego reinstalarlo todo.

Si esto falla, puede probar el método aptitude; a menudo es capaz de desenredar mejor los árboles de dependencia.

En ambos casos, tenga cuidado al aplicar comandos y revise cuidadosamente la lista de paquetes marcados para eliminar.


  • 132 Cuando probé eso con Wine1.6, apt-mark showhold no genera nada. ¿Alguna otra idea? (También estoy en Ask Ubuntu Chat) :) El fantasma de Madara 21 de diciembre de 2013 a las 11:18
  • 24 Sí. Yo también. Para mí, este comando nunca generó nada. - yPhil 13 de abril de 2014 a las 17:37
  • 6 A los lectores: ¡asegúrense de consultar el consejo de @DragonLord para usar aptitude! Funciona muy bien. - usuario146300 22 de julio de 2016 a las 9:33
  • 6 Sí, estoy de acuerdo. Muchas veces aptitude es capaz de desenredar árboles de dependencias de una mejor manera que simplemente apt. -Rmano 23 de julio de 2016 a las 8:34
  • 2 apt-mark showhold no hace nada por mí. -kRazzy R 10 de noviembre de 2017 a las 23:26


------------Respuesta------------

Para resolver este problema, solo tuve que instalar Synaptic primero usando el siguiente comando y luego todo funciona bien.

sudo apt-get install synaptic


>
------------Respuesta------------

Descubrí que dpkg -r me permite eliminar paquetes uno por uno, sin desencadenar una cascada de otros comportamientos.

No estoy seguro de que sea una buena solución, pero la seguí y todo parece estar bien.


  • dselect es una herramienta aún mejor (un poco de curva de aprendizaje, pero brinda más comentarios). -isomorfismos 1 de agosto de 2017 a las 22:37