0

Ребят, проблема с установкой npm. пытаюсь установить на VPS под Ubuntu 16.04.2

sudo apt-get install 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:
 npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

В данном случае, в ответе сказано, что некоторые пакеты не могут быть установлены, и следующие пакеты имеют неудовлетворённые зависимости:

npm : Depends: node-gyp (>= 0.10.9) 

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

Во множестве гайдов предлагается выполнить ряд команд, который в последствии должны исправить проблему. аналогично данному При выполнении sudo apt-get update в конце выполнения фигурируют следующие строки

Reading package lists... Done
W: The repository 'http://old-releases.ubuntu.com/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://old-releases.ubuntu.com/ubuntu xenial-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

sudo apt-get dist-upgrade так же не решил проблему.

Получается, что проблема с зависимостями. Мучаюсь уже долгое время. Как я понимаю нужно подредачить один из файлов /etc/apt/sources.list но что именно там нужно заменить не понимаю. помогите пожалуйста с решением.

nodejs -v v0.10.25

Результат команды tail -n 100 /etc/apt/sources.list /etc/apt/sources.list.d/*

==> /etc/apt/sources.list <==
deb http://old-releases.ubuntu.com/ubuntu xenial main restricted universe
deb http://old-releases.ubuntu.com/ubuntu xenial-updates main restricted universe
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb http://archive.ubuntu.com/ubuntu trusty main universe
tail: cannot open '/etc/apt/sources.list.d/*' for reading: No such file or directory
5
  • используйте официальные репозитории с более свежими версиями nodejs.org/en/download/package-manager/…
    – etki
    16 мая 2017 в 7:25
  • но что именно там нужно заменить не понимаю — ну так приложите к тексту вопроса (нажав править) вывод команды $ tail -n 100 /etc/apt/sources.list /etc/apt/sources.list.d/* 16 мая 2017 в 7:46
  • @etki, официальные репоозитории находятся на сайте archive.ubuntu.com (и на его зеркалах). приведённая вами ссылка никакого отношения к дистрибутиву ubuntu вообще не имеет. // да, я понимаю, что вы просто некорректно сформулировали мысль. 16 мая 2017 в 7:52
  • @alexanderbarakin это официальные репозитории nodejs
    – etki
    16 мая 2017 в 7:53
  • @alexanderbarakin barakin спасибо за помощь в решении вопроса, результат команды прикрепил.
    – Tony Rose
    16 мая 2017 в 10:16

1 ответ 1

1

имеет смысл привести файл /etc/apt/sources.list к такому примерно виду (сгенерировано при помощи сайта https://repogen.simplylinux.ch/):

deb http://mirror.yandex.ru/ubuntu/ xenial main restricted universe multiverse
deb http://mirror.yandex.ru/ubuntu/ xenial-security main restricted universe multiverse 
deb http://mirror.yandex.ru/ubuntu/ xenial-updates main restricted universe multiverse 
deb http://mirror.yandex.ru/ubuntu/ xenial-proposed main restricted universe multiverse

после этого обновите список пакетов:

$ sudo apt-get update

и попробуйте вновь установить нужный вам пакет.

5

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.