• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

rpm: Command Examples in Linux

by Deepika

The “rpm” command is the default package manager used in most Linux distributions that use the Red Hat Package Manager (RPM) format. The RPM format is used to package software applications and their dependencies, making it easier to install, manage, and update software packages on a Linux system.

The “rpm” command is used to manage these packages, including installing, removing, querying, and verifying their contents. It can also be used to update packages and manage dependencies.

rpm Command Examples

1. Show version of httpd package:

# rpm --query httpd

2. List versions of all matching packages:

# rpm --query --all 'mariadb*'

3. Forcibly install a package regardless of currently installed versions:

# rpm --upgrade package_name.rpm --force

4. Identify owner of a file and show version of the package:

# rpm --query --file /etc/postfix/main.cf

5. List package-owned files:

# rpm --query --list kernel

6. Show scriptlets from an RPM file:

# rpm --query --package --scripts package_name.rpm

7. Show changed, missing and/or incorrectly installed files of matching packages:

# rpm --verify --all 'php-*'

8. Display the changelog of a specific package:

# rpm --query --changelog package_name

The “rpm” command can also be used to create RPM packages from source code, which can be distributed and installed on other Linux systems. This is done using the “rpmbuild” subcommand, which allows you to create source RPMs and binary RPMs for your software.

Overall, the “rpm” command is a powerful and flexible tool for managing software packages on Linux systems. It provides a robust system for managing dependencies and ensuring that software applications are installed correctly and consistently across different systems.

Filed Under: Linux

Some more articles you might also be interested in …

  1. needrestart: command not found
  2. How to generate PGP keys using GPG on Linux
  3. How to mount USB flash drive in Linux
  4. Beginners Guide to MySQL User Management
  5. nsnake Command Examples in Linux
  6. bat Command Examples in Linux
  7. How to log every shell command in Linux
  8. sudoedit: command not found
  9. halt: command not found
  10. CentOS / RHEL : How to exclude kernel or other packages from getting updated using YUM Versionlock Plugin

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright