How do you track which packages were installed on Fedora (Linux)?

8,209

Solution 1

yum list installed and yum.log will show what's been installed, but I don't think anything on the system differentiates between packages you chose to install and those that were installed as dependencies

Solution 2

Try using sudo yum history packages-list \*

It will show what was installed explicitly and what was installed as a dependency:

ID | Action(s)      | Package                                              
-------------------------------------------------------------------------------
47 | Dep-Install    | cairomm-1.8.0-2.1.el6.x86_64                         
47 | Dep-Install    | glibmm24-2.22.1-1.el6.x86_64                         
47 | Install        | gnome-system-monitor-2.28.0-11.el6.x86_64

Solution 3

Presuming you still have the /root/install.logfile from the original installation, you could create the files rpm.orig and rpm.curr thus:

cd /root
rpm -qa --qf '%{NAME}\n' | sort -u > rpm.curr
awk '($1=="Installing"){print $2}' install.log | sort -u > rpm.orig

Then, to see packages added:

comm -13 rpm.orig rpm.curr

And ones removed:

comm -23 rpm.orig rpm.curr

Note that if you have an x86_64 installation, it won't tell the difference between the 32- and 64-bit packages.

Share:
8,209

Related videos on Youtube

quark
Author by

quark

Updated on September 17, 2022

Comments

  • quark
    quark almost 2 years

    (This question is very similar to 6338. It was suggested that it be split from it as Fedora and Ubuntu/Debian are different enough to warrant different answers.)

    As I use any Fedora setup I gradually install a number of packages over and above the baseline installation. If I reinstall, or if I need to install a new machine, I usually want to reinstall those specific packages, and I want to do it fast to get back to work with a minimum of hassle. As far as I've seen all of the package managers (yum and pirut) can tell me which packages are installed, and they all have logs (albeit different ones for each tool, which is a hassle). But none of them can tell me which packages I've installed, as opposed to their dependencies or system updates. Even the logs are tricky in that I'm not entirely sure what I should be extracting from them, or how to integrate them (in the case of the various apt family tools). This means that each time I re-install, or even just backup, I'm not sure how to re-create that list.

    I'm not necessarily expecting any of the tools to do this for me, but if they don't I'm looking for workarounds. Even patterns to grep for, good rules of thumb, or a clear idea of what exactly is being logged, would be useful. There may not be a "best answer" here but good ones would be very helpful.

  • quark
    quark almost 15 years
    That lists all the packages yes, but it doesn't distinguish between ones I've added and ones that were already on the system. I want to track specifically packages I explicitly installed.
  • vonbrand
    vonbrand over 11 years
    All packages were explicitly installed by you. You'd need to be a lot more specific on what you want to do to in order to get meaningful help.