how to get list of all rpm packages installed on Linux using Perl. any help is appreciated.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I guess you can always use the
rpmcommand:You can then use this in a wide variety of ways:
Or:
I’ve also found RPM::Database which would be a more Perlish way of doing things. This package ties the RPM database to a hash:
I have never used it, so I’m not sure exactly how it would work. For example, I assume that the value of each hash entry is some sort of database object. For example, I would assume that it would be important to know the version number and the files in your RPM package, and there must be someway this information can be pulled, but I didn’t see anything in
RPM::Databaseor in RPM::HEader. Play around with it. You can use Data::Dumper to help explore the objects returned.WARNING: Use
Data::Dumperto help explore the information in the objects, and the classes. Don’t use it to figure out how to pull the information directly from the objects. Use the correct methods and classes.