So I have a package that I am pretty sure that I removed part of one of its dependencies when removing something(as in rm). Long story. Basically what I want to do is have yum re-install the package and all of its dependencies so that it will re-install the files I removed. In the gentoo world you simply do it like this "emerge -e ". It seems yum should be able to do something similar.

I guess I could cobble together a script to list the deps and then parse those out and re-install all of them.

3 Answers 3


Yeh, there's no easy way to do this ... however you can do a few things:

rpm -Va

...this will do a check on all the packages you have installed, and you can then reinstall anything that doesn't verify. Also:

yum reinstall $(repoquery --requires --recursive --resolve <pkg>)

...this will do what you asked for, although it's a big hammer.

  • quite useful on broken installs, like what I got lately after fedup.
    – dashesy
    Jan 8, 2015 at 2:38

If you're on Fedora and using dnf it's very easy. Just use the dnf history rollback feature.




yum reinstall $(yum list installed | awk '{print $1}')


rpm -qa | xargs yum reinstall

(depending on damage already done on the machine awk or xargs might not work)

  • 4
    That reinstalls all packages -- not just the dependencies of an individual package. May 20, 2015 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.