Ask Your Question
1

How to use rpm to list dependent packages?

asked 2018-02-16 20:47:42 -0500

mr_johnson22 gravatar image

Is it possible to use rpm to display which packages depend on / are depended by a particular package?

I'm aware of rpm -q <package> --requires/provides and rpm -q --whatprovides/--whatrequires <package>, but something about it makes it not list all dependent packages, or at least there's another step to getting it to show what I want it to.

In my experience, the only reliable way to find dependent packages is to attempt to uninstall a package with dnf, which shows a list of all dependent packages (and unused dependencies, if any) that would also be removed.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-02-16 21:12:11 -0500

davidva gravatar image

updated 2018-02-16 22:28:28 -0500

Simple....

dnf repoquery --available --alldeps --source --whatrequires foo_package

Other....

rpm -qR foo_package
edit flag offensive delete link more

Comments

This doesn't seem to work. For example, attempting to uninstall vlc with dnf shows many unused dependencies that will also be removed along with it, such as ffmpeg-libs, opencore-amr, zvbi, and others, implying that they are all dependencies of vlc. But none of them appear in the output of either of those dnf repoquery commands (and the second one throws an error).

mr_johnson22 gravatar imagemr_johnson22 ( 2018-02-16 21:53:40 -0500 )edit

Updated...

davidva gravatar imagedavidva ( 2018-02-16 22:27:11 -0500 )edit

I think you have it backwards. It's not that vlc needs all of those packages, but that at least some of them need vlc. Thus, when you remove it, they have to go as well because they can't work without it.

sideburns gravatar imagesideburns ( 2018-02-16 22:51:24 -0500 )edit

@davidva, thanks for the update.

@sideburns, maybe I'm getting ahead of myself...

If package Y is a "dependent package" of package X, does that mean package X depends on package Y?

If package Z is a "unused dependency" of package X, does that mean package Z depends on package X?

If the above is correct, then I would expect rpm -qR vlc to show at least all packages that vlc depends on, and for dnf repoquery --available --alldeps --source --whatrequires vlc to show at least all packages that depend on vlc. That's not what I'm seeing, so there must be something I'm missing.

mr_johnson22 gravatar imagemr_johnson22 ( 2018-02-16 23:29:26 -0500 )edit

It makes a difference when you have autoremove enabled when you remove packages. autoremove can be quite aggressive in removing packages that might no longer be needed.

Try dnf remove --noautoremove vlc and check the list of packages to be removed.

villykruse gravatar imagevillykruse ( 2018-02-16 23:59:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-02-16 20:47:42 -0500

Seen: 1,462 times

Last updated: Feb 16 '18