Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list of packages installed with yum on CentOS 5.4

[root@server ~]# yum list installed
Installed Packages
GConf2.x86_64             2.14.0-9.el5           installed
ImageMagick.x86_64      installed
MAKEDEV.x86_64            3.23-1.2               installed
MySQL-python.x86_64       1.2.1-1                installed

I would like to download these rpms locally using

yumdownloader --resolve MySQL-python-1.2.1-1.x86_64 etc.

However the package formatting is different (MySQL-python.x86_64 1.2.1-1 vs MySQL-python-1.2.1-1.x86_64) so I am unable to download them using the above command.

I don't want to have to parse the output of yum list installed, and I also don't want to use the contents of /var/log/yum.log* as I'll have to account for erased packages and version discrepancies. However /var/log/yum.log* does have the formatting I require...

May 25 14:58:15 Installed: groff-
May 25 14:58:15 Installed: bzip2-1.0.3-4.el5_2.x86_64

Any suggestions?

share|improve this question
up vote 4 down vote accepted

You can use rpm to list the installed rpms and format the output:

rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n"
share|improve this answer
Most excellent sir, many thanks. – Andy May 27 '10 at 13:41

Your Answer


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.