E: incapaz de corregir problemas, ha tenido paquetes rotos

80

Estoy usando Ubuntu 13.04 que instalé hace unos días. Estoy tratando de instalar nodejs y npm . Traté de instalar desde la línea de comandos primero 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 está debajo:

# 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á debajo:

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
    
pregunta John Qualis 21.10.2013 - 19:07

4 respuestas

20

Debería poder ver la lista de paquetes retenidos por:

apt-mark showhold 

y luego desactívelos por

sudo apt-mark unhold <package name>

Después de eso, debería poder eliminar el paquete en conflicto (parece ser npm ) y luego reinstalar todo.

Si esto falla, puedes probar el aptitude way --- a menudo es capaz de desenredar mejor los árboles de dependencia. .

En ambos casos, tenga cuidado al aplicar comandos, y verifique cuidadosamente la lista de paquetes que están marcados para eliminar.

    
respondido por el Rmano 21.10.2013 - 20:15
181

Utilice aptitude en lugar de apt-get. Es mas inteligente No solo gestionará la degradación de paquetes conflictivos, sino que hará una serie de recomendaciones preguntándole cuál de los posibles escenarios de trabajo sugeridos desea.

sudo aptitude install myNewPackage

Si todavía no tiene aptitude en su máquina, obténgalo con

sudo apt-get install aptitude
    
respondido por el DragonLord 20.04.2014 - 05:40
4

Para que resolviera este problema, solo tenía que instalar Synaptic primero usando el comando a continuación, y luego todo funciona bien.

sudo apt-get install synaptic
    
respondido por el Alaa ElSaman 17.12.2013 - 00:19
0

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

No estoy seguro de que esta sea una buena solución, pero fui con ella y todo parece estar bien.

    
respondido por el isomorphismes 28.07.2017 - 18:29

Lea otras preguntas en las etiquetas