Назад | Перейти на главную страницу

Заменить пакеты CentOS / RedHat из другого репозитория

Я унаследовал сервер CentOS, на котором установлен nodejs из репозитория epel. Однако мне нужна его конкретная версия, поэтому я установил репозиторий nodejs, но я не могу обновить его из нового репозитория, поскольку он сообщает мне следующее:

Loaded plugins: fastestmirror
nodesource                                                                                                                                                                                    | 2.5 kB  00:00:00     
nodesource/x86_64/primary_db                                                                                                                                                                  |  38 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: ftp.freepark.org
 * epel: mirror.imt-systems.com
 * extras: ftp.freepark.org
 * remi: mirror.23media.de
 * remi-php56: mirror.23media.de
 * remi-safe: mirror.23media.de
 * updates: ftp.freepark.org
Resolving Dependencies
--> Running transaction check
---> Package npm.x86_64 1:3.10.10-1.6.9.4.2.el7 will be updated
---> Package npm.x86_64 1:3.10.10-1.6.10.1.2.el7 will be an update
--> Processing Dependency: nodejs = 1:6.10.1-2.el7 for package: 1:npm-3.10.10-1.6.10.1.2.el7.x86_64
--> Running transaction check
---> Package nodejs.x86_64 1:6.9.4-2.el7 will be updated
--> Processing Dependency: nodejs(x86-64) = 1:6.9.4-2.el7 for package: 1:nodejs-devel-6.9.4-2.el7.x86_64
---> Package nodejs.x86_64 1:6.10.1-2.el7 will be an update
--> Running transaction check
---> Package nodejs-devel.x86_64 1:6.9.4-2.el7 will be updated
---> Package nodejs-devel.x86_64 2:6.10.2-2nodesource.el7.centos will be an update
--> Processing Dependency: nodejs(x86-64) = 2:6.10.2-2nodesource.el7.centos for package: 2:nodejs-devel-6.10.2-2nodesource.el7.centos.x86_64
epel/x86_64/filelists_db                                                                                                                                                                      | 7.7 MB  00:00:00     
--> Running transaction check
---> Package nodejs.x86_64 1:6.9.4-2.el7 will be updated
---> Package nodejs.x86_64 1:6.9.4-2.el7 will be updated
---> Package nodejs.x86_64 1:6.10.1-2.el7 will be an update
--> Processing Dependency: nodejs = 1:6.10.1-2.el7 for package: 1:npm-3.10.10-1.6.10.1.2.el7.x86_64
---> Package nodejs.x86_64 2:6.10.2-2nodesource.el7.centos will be an update
--> Finished Dependency Resolution
Error: Package: 1:npm-3.10.10-1.6.10.1.2.el7.x86_64 (epel)
           Requires: nodejs = 1:6.10.1-2.el7
           Removing: 1:nodejs-6.9.4-2.el7.x86_64 (@epel)
               nodejs = 1:6.9.4-2.el7
           Updated By: 2:nodejs-6.10.2-2nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.10.2-2nodesource.el7.centos
           Available: nodejs-6.0.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 6.0.0-1nodesource.el7.centos
           Available: nodejs-6.1.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 6.1.0-1nodesource.el7.centos
           Available: nodejs-6.2.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 6.2.0-1nodesource.el7.centos
           Available: nodejs-6.2.1-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 6.2.1-1nodesource.el7.centos
           Available: nodejs-6.2.2-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 6.2.2-1nodesource.el7.centos
           Available: 1:nodejs-6.3.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 1:6.3.0-1nodesource.el7.centos
           Available: 1:nodejs-6.3.1-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 1:6.3.1-1nodesource.el7.centos
           Available: 1:nodejs-6.4.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 1:6.4.0-1nodesource.el7.centos
           Available: 1:nodejs-6.6.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 1:6.6.0-1nodesource.el7.centos
           Available: 1:nodejs-6.7.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 1:6.7.0-1nodesource.el7.centos
           Available: 1:nodejs-6.10.1-2.el7.x86_64 (epel)
               nodejs = 1:6.10.1-2.el7
           Available: 2:nodejs-6.8.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.8.0-1nodesource.el7.centos
           Available: 2:nodejs-6.8.1-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.8.1-1nodesource.el7.centos
           Available: 2:nodejs-6.9.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.9.0-1nodesource.el7.centos
           Available: 2:nodejs-6.9.1-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.9.1-1nodesource.el7.centos
           Available: 2:nodejs-6.9.2-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.9.2-1nodesource.el7.centos
           Available: 2:nodejs-6.9.3-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.9.3-1nodesource.el7.centos
           Available: 2:nodejs-6.9.4-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.9.4-1nodesource.el7.centos
           Available: 2:nodejs-6.9.5-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.9.5-1nodesource.el7.centos
           Available: 2:nodejs-6.10.0-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.10.0-1nodesource.el7.centos
           Available: 2:nodejs-6.10.1-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.10.1-1nodesource.el7.centos
           Available: 2:nodejs-6.10.2-1nodesource.el7.centos.x86_64 (nodesource)
               nodejs = 2:6.10.2-1nodesource.el7.centos
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Как бы вы решили эту проблему?

репо не завершено. В нем перечислены несовместимые версии для разных частей расчета зависимостей. Это САМОЗАВРАЩЕННОЕ состояние, известное как Ад зависимости. Это случается, когда вы смешиваете дрянные сторонние репозитории. Также, пожалуйста, поймите, что установка сторонних программ открывает перед вами огромное количество проблем поддержки, проблем с безопасностью и проблем с исчезающими пакетами. Пожалуйста, серьезно подумайте, будет ли выпуск чего-то на этой неделе стоить так много вашего времени на постоянной основе, и подумайте, действительно ли вы действительно хотите вместо этого перейти на новый блестящий хост c7.

Загляни внутрь /etc/yum.repos.d/ каталог (ls /etc/yum.repos.d/) вы, вероятно, увидите что-то вроде nodesource-el7.repo. Выполните следующие команды:

sudo rm /etc/yum.repos.d/nodesource-el7.repo
yum clean all 

Сейчас yum repolist команда не должна иметь nodesource-el7.repo в отображаемом списке.

Давайте установим nodejs и npm

curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum install -y nodejs

(8.x выше может быть 9.x или 10.x, или любой другой версией узла, которую вы хотите)

Давайте проверим нашу установку

node -v
npm -v

(Надеюсь) Победа!