E: Unable to correct problems, you have held broken packages
I am using Ubuntu 13.04 which I installed few days back. I am trying to install nodejs and npm. I tried to install from command line first and then uninstalled it. Then something broke.
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.The output of /etc/apt/sources.list is below:
# deb cdrom:[Ubuntu 13.04 _Raring Ringtail_ - Release amd64 (20130424)]/ raring main restricted
# See for how to upgrade to
# newer versions of the distribution.
deb raring main restricted
deb-src raring main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb raring-updates main restricted
deb-src 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 raring universe
deb-src raring universe
deb raring-updates universe
deb-src 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 raring multiverse
deb-src raring multiverse
deb raring-updates multiverse
deb-src 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 raring-backports main restricted universe multiverse
deb-src raring-backports main restricted universe multiverse
deb raring-security main restricted
deb-src raring-security main restricted
deb raring-security universe
deb-src raring-security universe
deb raring-security multiverse
deb-src 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 raring partner
# deb-src raring partner
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb raring main
deb-src raring mainThe output of /etc/apt/sources.list.d/* is below:
deb raring main
# deb-src raring main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb stable main
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb stable main
deb stable non-free
deb stable non-free
deb stable non-free
deb stable non-free 5 4 Answers
Use aptitude instead of apt-get. It is more intelligent. It not only will handle downgrading conflicting packages for you, but will make a series of recommendations asking you which of many possible suggested working scenarios you would like.
sudo aptitude install myNewPackageIf you don't have aptitude on your machine yet, get it with
sudo apt-get install aptitude 13 You should be able to see the list of held packages by:
apt-mark showhold and then un-hold them by
sudo apt-mark unhold <package name>After that, you should be able to remove the conflicting package (it seems to be npm) and then reinstall all.
If this fail, you can try the aptitude way --- often it's able to disentangle dependency trees better.
In both cases, be careful when applying commands, and check carefully the list of packages that are marked for remove.
8For me to solve this problem, I just had to install synaptic first using below commmand, and then everything works fine.
sudo apt-get install synaptic I found out that dpkg -r allows me to remove packages one-by-one, without triggering a cascade of other behaviour.
I am not sure this is a good solution, but I went with it and everything seems fine.
1More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"