E: impossibile correggere i problemi, hai tenuto dei pacchetti rotti

79

Sto usando Ubuntu 13.04 che ho installato pochi giorni fa. Sto cercando di installare nodejs e npm . Ho provato a installare da riga di comando prima e poi disinstallato. Poi qualcosa si è rotto.

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.

L'output di /etc/apt/sources.list è sotto:

# 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

L'output di /etc/apt/sources.list.d/* è sotto:

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

4 risposte

20

Dovresti essere in grado di vedere l'elenco dei pacchetti in attesa di:

apt-mark showhold 

e quindi disattivalo con

sudo apt-mark unhold <package name>

Dopodiché dovresti essere in grado di rimuovere il pacchetto in conflitto (sembra essere npm ) e quindi reinstallare tutto.

Se questo non funziona, puoi provare il aptitude modo --- spesso è in grado di districare meglio gli alberi di dipendenza .

In entrambi i casi, fare attenzione quando si applicano i comandi e controllare attentamente l'elenco di pacchetti contrassegnati per la rimozione.

    
risposta data Rmano 21.10.2013 - 20:15
178

Usa aptitude invece di apt-get. È più intelligente. Non solo gestirà il downgrade di pacchetti in conflitto per te, ma fornirà una serie di consigli che ti chiedono quale tra i possibili scenari di lavoro suggeriti che desideri.

sudo aptitude install myNewPackage

Se non hai ancora aptitude sul tuo computer, fallo con

sudo apt-get install aptitude
    
risposta data DragonLord 20.04.2014 - 05:40
4

Per risolvere questo problema, ho dovuto installare prima Synaptic usando sotto il comando, quindi tutto funziona correttamente.

sudo apt-get install synaptic
    
risposta data Alaa ElSaman 17.12.2013 - 00:19
0

Ho scoperto che dpkg -r mi consente di rimuovere i pacchetti uno alla volta, senza innescare una cascata di altri comportamenti.

Non sono sicuro che questa sia una buona soluzione, ma ci sono andato e tutto sembra a posto.

    
risposta data isomorphismes 28.07.2017 - 18:29

Leggi altre domande sui tag