Is there an easy way to make a list of the dependencies a newly installed RPM package will install with yum
?
Example: If you do yum install ruby
then it will also install some rubygems.
But when I uninstall the ruby
package I also want to get rid of the dependencies it installed.
So my first idea were to make a list of those new packages, and then do an rpm -e
on those when I uninstall ruby
.
Question
How to make such list in an automated way?
Or is there an easier way then to have to manage text files with rpm package names?
yum
keeps its own history, so you can find out when a package was installed or updated using its history.For instance,
yum history packages-info ruby
will give you all the transactions involving ruby, where the oldest one is usually the one where the package was installed.This will give you the transaction ID, which you can then look up and find the dependencies which were installed, e.g. with
yum history info <ID>
.If the package was just installed, and hasn't yet been updated, you can rollback the transaction with, e.g.
yum history undo 102
. This won't work if any of the packages has been updated since installation, though, as it matches name, version and release.And if you really just installed the packages, you can skip everything else and run
yum history undo last
to rollback the most recent transaction.You can remove them with
yum autoremove
.