Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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        6.2.8.0-4.el5_1.1      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-1.18.1.1-11.1.x86_64
May 25 14:58:15 Installed: bzip2-1.0.3-4.el5_2.x86_64

Any suggestions?

share|improve this question
add comment

1 Answer

up vote 3 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
add comment

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.