How to install dependencies of an rpm package without installing the package itself? (rhel/fedora)?

Описание к видео How to install dependencies of an rpm package without installing the package itself? (rhel/fedora)?

Unix & Linux: How to install dependencies of an rpm package without installing the package itself? (rhel/fedora)?


The Question: I have a set of packages (*.rpm). For each package I can do rpm -qRp <package>
to list requires, but I would like to install them (those requires) without
installing the packages themselves. The requires all live in enabled
repositories. Is there some easy way to do this without writing my own script
that would parse output of rpm -qRp ... for example.
I know I could do it by installing everything with requires (yum localinstall)
and then uninstalling the original packages, but the problem is that my set
contains packages with both dependencies and conflicts in between them. The
required packages however don't conflict. I would have to do multiple yum
localinstall <list> followed by yum remove <list> and make sure the packages in
list don't conflict.
I there a better way? I would basically like something like yum-builddep, but
for requires, not buildrequires.
My distros are Fedora/RHEL

Solutions: Please watch the whole video to see all solutions, in order of how many people found them helpful

== This solution helped 25 people ==
You can use the yum deplist command to generate a list of package dependencies:
$ yum deplist bind
dependency: /bin/bash
provider: bash.x86_64 4.3.39-5.fc21
dependency: /bin/sh
provider: bash.x86_64 4.3.39-5.fc21
dependency: bind-libs(x86-64) = 32:9.9.6-10.P1.fc21
provider: bind-libs.x86_64 32:9.9.6-10.P1.fc21
dependency: coreutils
provider: coreutils.x86_64 8.22-22.fc21
[...]
Grab the provider: lines from this for a list of packages:
$ yum deplist bind | awk '/provider:/ {print $2}' | sort -u
bash.x86_64
bind-libs.x86_64
coreutils.x86_64
glibc.i686
glibc.x86_64
grep.x86_64
krb5-libs.x86_64
libcap.x86_64
libcom_err.x86_64
libxml2.x86_64
openssl-libs.x86_64
shadow-utils.x86_64
systemd.x86_64
zlib.x86_64
Send this output to yum install to install the packages:
$ yum deplist bind | awk '/provider:/ {print $2}' | sort -u |
xargs yum -y install

With thanks & praise to God, and with thanks to the many people who have made this project possible! | Content (except music & images) licensed under cc by-sa 3.0 | Music: https://www.bensound.com/royalty-free... | Images: https://stocksnap.io/license & others | With thanks to user Miroslav Franc (https://unix.stackexchange.com/users/..., user larsks (https://unix.stackexchange.com/users/..., user James Antill (https://unix.stackexchange.com/users/..., user Gilles 'SO- stop being evil' (https://unix.stackexchange.com/users/..., and the Stack Exchange Network (http://unix.stackexchange.com/questio.... Trademarks are property of their respective owners. Disclaimer: All information is provided "AS IS" without warranty of any kind. You are responsible for your own actions. Please contact me if anything is amiss at Roel D.OT VandePaar A.T gmail.com.

Комментарии

Информация по комментариям в разработке