44

I'm trying to install winswitch on CentOs 6. It requires nxagent. But in centos, the package name is nx. Is there a way to tell yum to skip checking the nxagent dependency (I installed nx already)? Specifying --skip-broken skips the whole thing.

pevik
  • 286
  • 1
  • 12
IttayD
  • 1,037
  • 4
  • 11
  • 14

6 Answers6

70

The rpm command has the --nodeps option that you can use. A challenge is that rpm by itself is not aware of yum repositories. The following command will install or update the package, ignoring dependencies, but automatically looking up the download URL from your repositories with repoquery which is in package yum-utils.

rpm -Uvh --nodeps $(repoquery --location winswitch)

After that, a regular yum update will likely succeed without dependency errors.

Onnonymous
  • 1,064
  • 1
  • 9
  • 14
  • $(repoquery --location winswitch) did not work for me. However, one can download .rpm package via "yumdownloader --destdir=. package-name" . "rpm -U" means upgrade. If the package was not installed, one can use "rpm -i" for that. yumdownloader is from yum-utils (dnf-utils in my case). – Yaroslav Nikitenko Nov 25 '18 at 11:47
16

Generally yum doesn't have options to ignore a single package from the dependencies. Option --skip-broken ignores all unresolved dependences.

You can try yum --exclude=packagename but it excludes a specific package by name or glob from updates on all repositories, not from dependencies.

slm
  • 7,355
  • 16
  • 54
  • 72
B14D3
  • 5,110
  • 13
  • 58
  • 82
4

It sounds like you're trying to install package that has not been designed for the OS, i.e. if it was designed for CentOS it would require nx correctly.

Another workaround for the problem is to create and install a small shim RPM package that contains no files, but in the spec file contains the following lines (amongst others):

requires: nx
provides: nxagent

That way the dependency should be satisfied however it may be expecting files to be in a location that differs between the nxagent package it expects to have installed and the nx package that CentOS provides.

bodgit
  • 4,661
  • 13
  • 26
1

This one-liner example does it ( tigervnc-server is the package being installed )

rpm -ivh --nodeps ` yumdownloader tigervnc-server | perl -ne 'print $2 if(/^(\[.+\]\s*|)(.*?\.rpm)[\s:]/)'`
cnd
  • 220
  • 2
  • 5
1

Use yumdownloader to automatically download the package for you, then use rpm -i and --nodeps to install the package without dependency checks.

linuxman1
  • 101
  • 1
  • 4
1

you can also use rpmrebuild to change the rpm metadata to point at the new package name. this will then be "your" package, but is cleaner as far as the rpm dependencies go. There's no disadvantage over using --nodeps I think.

Florian Heigl
  • 1,440
  • 12
  • 19