Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

(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.

share|improve this question

7 Answers 7

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

share|improve this answer

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|improve this answer

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
share|improve this answer

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

share|improve this answer
3  
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. –  quark Jul 22 '09 at 16:12
    
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 Jan 16 '13 at 13:29

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.

share|improve this answer

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
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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