Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:35:46+00:00 2026-05-26T04:35:46+00:00

how to get list of all rpm packages installed on Linux using Perl. any

  • 0

how to get list of all rpm packages installed on Linux using Perl. any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:35:47+00:00Added an answer on May 26, 2026 at 4:35 am

    I guess you can always use the rpm command:

    $ rpm --query --all  --qf "%-30{NAME} - %{VERSION}\n"
    

    You can then use this in a wide variety of ways:

    use autodie;
    open my $RPM_FH, "-|", qq(rpm --query --all --qf "%-30{NAME} - %{VERSION}\n");
    my @rpmLines = <$RPM_FH>;
    close $RPM_FH;
    

    Or:

     my @rpmLines = qx(rpm --query --all --qf "%-30{NAME} - %{VERSION}\n");
    

    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:

    use RPM::Database;
    
    tie %RPM, "RPM::Database" or die "$RPM::err";
    
    for (sort keys %RPM)
    {
        ...
    }
    

    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::Database or in RPM::HEader. Play around with it. You can use Data::Dumper to help explore the objects returned.

    WARNING: Use Data::Dumper to 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any tool or regexp that might help to get list of all
Is it possible to get list of all existing accounts from Outlook 2003 using
Possible Duplicate: Get list of all input objects using JavaScript, without accessing a form
I am using webbrowser control , and i get list of all the url
is there any way (or API) to use to get a list of all
I'm using readlines method from python to get list of all data lines. Now
How can I get list of all tables in SQL Server database using query.
I am trying to get list of all SQL Servers installed in the machine
i want to get list of all application or Threads attached with a process.For
How can I to get list of all wcf services running on a machine?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.