Sys Admin

Snippet to retrieve the RPM package's name installed on an offline system

Fabrice

Dec. 27, 2015

RPM

There is an RPM command to get the name's of the installed RPM packages on your system:

rpm -qa --qf "%{NAME}\n"

But when the system is offline, you cannot use it. However you can dump the db database and perform a not so bad data extraction using this command:

db_dump -d a /path-to/var/lib/rpm/Name | sed -e 's/.*data: //' | grep -v '00000' | grep -E '^[a-zA-Z]' | grep -v ' ' | sort -n

There is certainly a better solution, but I don't know it.