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

11

2

(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

Posted 2009-07-22T00:14:39.773

Reputation: 868

Answers

3

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

theotherreceive

Posted 2009-07-22T00:14:39.773

Reputation: 798

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

Francisco

Posted 2009-07-22T00:14:39.773

Reputation: 1 250

2

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.

user14749

Posted 2009-07-22T00:14:39.773

Reputation:

0

This is an easy one.

Just run the below command in your favorite shell. The manpage for RPM will be painfully illustrative if you need to take a deeper dive on this.

rpm -qa

Axxmasterr

Posted 2009-07-22T00:14:39.773

Reputation: 7 584

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. – vonbrand – 2013-01-16T13:29:51.337

3That 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. – quark – 2009-07-22T16:12:35.143

0

The file /root/install.log will tell you which packages were included in the initial install. Here's a quick script that will compare the contents of this file with the output of rpm -qa:

rpm -qa | sort > /root/postinstall.list
for P in `sed -n 's/Installing \(.*\)/\1/p' </root/install.log`
do
  sed -ie "/$P/d" /root/postinstall.list
done

The file /root/postinstall.list contains what you want. Note that packages that are an upgraded version of an originally installed package will appear in the file. If this is not what you want, you will need a more sophisticated pattern in the sed statement.

dkaylor

Posted 2009-07-22T00:14:39.773

Reputation: 35

0

rpm -qa --last

from the man pages:

--last Orders the package listing by install time such that the latest packages are at the top.

Sample output:

mdadm-3.2.2-9.el6                             Mon 12 Dec 2011 10:06:17 AM EST
libdrm-2.4.25-2.el6                           Mon 12 Dec 2011 09:54:51 AM EST
tcp_wrappers-libs-7.6-57.el6                  Mon 12 Dec 2011 09:54:50 AM EST

Dejan

Posted 2009-07-22T00:14:39.773

Reputation: 914

0

Assuming you always used "yum" to install everything you can do:

sudo yum history info \* | grep "^Command Line   : install"

It should show you all "yum install" commands performed on the system after installation.

Quintesse

Posted 2009-07-22T00:14:39.773

Reputation: 101