rpm Command in Linux

Learn via video courses
Topics Covered

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Overview

In the Linux ecosystem, the rpm command serves as a robust utility for package management. Standing for Red Hat Package Manager, the rpm command in Linux offers the ability to install, uninstall, upgrade, query, and verify packages. It's a critical tool for system administrators, offering an efficient method for managing software on Linux distributions that use .rpm packages.

Syntax of rpm Command in Linux

The basic syntax of the rpm command in Linux is as follows:

Where:

  • options: These are the flags or switches that you can use with the rpm command. They tell the command what function to perform, such as installing, upgrading, or querying a package.
  • package_file | package_name: This is the specific .rpm package file or the installed package name you're dealing with. It could be a package you're looking to install, upgrade, verify, or remove.
Free Courses by top Scaler instructors
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science Course
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science Course

Options in rpm Command in Linux

  1. -i | --install: This option is used to install a new package.

    For example -

    This command will install the 'sample_package.rpm' package.

  2. -q | --query: This option is used to query an installed package or a .rpm package file.

    For example -

    Output:

    This command queries the installed 'sample_package' and returns its version if it exists.

  3. -e | --erase: This option is used to remove an installed package.

    For example -

    This command will remove the installed 'sample_package'.

Scaler Placement Report and Statistics

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more

Example Usages

  • Installing a package:

    Explanation: This usage of the rpm command in Linux installs 'sample_package.rpm'.

  • Querying a package:

    Output:

    Explanation: This usage queries the installed 'sample_package' and returns its version.

Tips

  • You can use the -v option along with -i, -e, or -U to get more detailed output.

  • To install or uninstall packages, you need to have root permissions or use sudo.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Advanced Use Cases of rpm Command in Linux

  • Upgrade a package:

    Explanation: This command will upgrade the 'sample_package' to the version provided in the .rpm file, or install it if it doesn't exist.

  • Query all installed packages:

    Output:

    Explanation: This command lists all installed packages on the system.

  • Verify an installed package:

    Explanation: This command verifies the integrity of the installed 'sample_package'. It compares the size, digest, permissions, type, owner, group, modification time, and capabilities of each file against the values from the database.

Conclusion

  • The rpm command in Linux provides a powerful tool for managing software packages.

  • The command includes options to install, uninstall, upgrade, query, and verify packages.

  • Being familiar with the rpm command is essential for system administrators managing Linux distributions that use .rpm packages.