E: Невозможно устранить проблемы, у вас есть поврежденные пакеты

Я использую Ubuntu 13.04, который я установил несколько дней назад. Я пытаюсь установить nodejs и npm. Сначала я попытался установить его из командной строки, а затем удалил. Потом что-то сломалось.

sudo apt-get install -f nodejs npmReading package lists... DoneBuilding dependency tree       Reading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor been moved out of Incoming.The following information may help to resolve the situation:The following packages have unmet dependencies: nodejs : Conflicts: npmE: Unable to correct problems, you have held broken packages.

Выход из /etc/apt/sources.list находится ниже:

# 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 restricteddeb-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 restricteddeb-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 universedeb-src http://in.archive.ubuntu.com/ubuntu/ raring universedeb http://in.archive.ubuntu.com/ubuntu/ raring-updates universedeb-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 multiversedeb-src http://in.archive.ubuntu.com/ubuntu/ raring multiversedeb http://in.archive.ubuntu.com/ubuntu/ raring-updates multiversedeb-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 multiversedeb-src http://in.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiversedeb http://security.ubuntu.com/ubuntu raring-security main restricteddeb-src http://security.ubuntu.com/ubuntu raring-security main restricteddeb http://security.ubuntu.com/ubuntu raring-security universedeb-src http://security.ubuntu.com/ubuntu raring-security universedeb http://security.ubuntu.com/ubuntu raring-security multiversedeb-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 maindeb-src http://extras.ubuntu.com/ubuntu raring main

Выход из /etc/apt/sources.list.d/* находится ниже:

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 maindeb http://deb.opera.com/opera/ stable non-freedeb http://deb.opera.com/opera/ stable non-freedeb http://deb.opera.com/opera/ stable non-freedeb http://deb.opera.com/opera/ stable non-free

Используйте aptitude вместо apt-get. Это более разумно. Он не только справится с понижением рейтинга конфликтующих пакетов для вас, но и даст ряд рекомендаций, в которых спросит вас, какой из многих возможных предложенных рабочих сценариев вы хотели бы использовать.

sudo aptitude install myNewPackage

Если у вас еще нет aptitude на вашем компьютере, получите его с помощью

sudo apt-get install aptitude

Вы должны иметь возможность просматривать список удерживаемых пакетов с помощью:

apt-mark showhold 

а затем снимите их с

sudo apt-mark unhold <package name>

После этого вы должны иметь возможность удалить конфликтующий пакет (похоже, это npm), а затем переустановите все.

Если это не удастся, вы можете попробовать aptitude путь --- часто это позволяет лучше распутывать деревья зависимостей.

В обоих случаях будьте осторожны при применении команд и внимательно проверьте список пакетов, помеченных для удаления.

Для меня, чтобы решить эту проблему, мне просто нужно было сначала установить synaptic, используя приведенную ниже команду, а затем все работает нормально.

sudo apt-get install synaptic

Я узнал, что dpkg -r позволяет мне удалять пакеты один за другим, не вызывая каскада других действий.

Я не уверен, что это хорошее решение, но я пошел на это, и все кажется прекрасным.

Вам нужно сначала установить его
`sudo apt-get update

sudo apt-получить обновление

sudo apt-get install synaptic`

Отвечает ли это на ваш вопрос? Невозможно исправить проблемы, вы удержали сломанный packages

Не уверен, в чем вопрос, однако это может вам помочь
Перейдите в synaptic package manager.
Редактировать > Исправить поврежденные пакеты.

Другой способ, которым вы можете получить аналогичную ошибку (хотя, по-видимому, не для OP), - это установить APT::Default-Release. Если для этого требуется установить пакет из более старой версии, чем уже существующие зависимости, они могут быть несовместимы, что приводит к той же ошибке.

когда я делаю “gksudo synaptic”, ничего не происходит