A simple guide installing and uninstalling Red Hat RPM packages from the command line

Many GNU/Linux distributions use the popular Red Hat Package Manager (RPM) system of adding or removing programs. Almost all Linux users will encounter the desire to add software to their computer, or remove a program that came with their version of Linux. While installing new software can be a complex, error-prone job, RPM will turn that arduous task into a single command.

Things You Should Know

  • Use "rpm -i packagename.rpm" to install a package.
  • To delete a package, use "rpm -e packagename.rpm."
  • You can use other flags with the rpm command to test installations, specify install paths, and more.
Method 1
Method 1 of 3:

Installation

  1. 1
    Download your desired RPM package. There are many RPM depositories on the Internet, but if you're looking for Red Hat RPM packages, you can find them here:
    • The Red Hat Enterprise Linux installation media, which contain many installable RPMs.
    • The initial RPM repositories provided with the YUM package manager.
    • The Extra Packages for Enterprise Linux (EPEL) provides high-quality add-on packages for Red Hat Enterprise Linux.
  2. 2
    Install the RPM package. Once downloaded, you have two options:
    • Double-click the package. A package management window will appear with instructions to guide you through the process.
    • Open a terminal window, and type rpm -i *package_location_and_name* (without the spaces in and )
  3. Advertisement
Method 3
Method 3 of 3:

Helpful RPM Flags

  1. 1
    The rpm -i command syntax is listed below.
  2. 2
    Install-specific options:
    • -h (or --hash) Print hash marks ("#") during install
    • --test Perform installation tests only
    • --percent Print percentages during install
    • --excludedocs Do not install documentation
    • --includedocs Install documentation
    • --replacepkgs Replace a package with a new copy of itself
    • --replacefiles Replace files owned by another package
    • --force Ignore package and file conflicts
    • --noscripts Do not execute pre- and post-install scripts
    • --prefix <path> Relocate package to <path> if possible
    • --ignorearch Do not verify package architecture
    • --ignoreos Do not verify package operating system
    • --nodeps Do not check dependencies
    • --ftpproxy<host> Use <host> as the FTP proxy
    • --ftpport <port> Use <port> as the FTP port
  3. 3
    General Options
    • -v Display additional information
    • -vv Display debugging information
    • --root <path> Set alternate root to <path>
    • --rcfile <rcfile> Set alternate rpmrc file to <rcfile>
    • --dbpath <path> Use <path> to find the RPM database
  4. Advertisement

Warnings

  • It is possible to over-write some data that is required for another program to run. Always be cautious whenever you add or remove anything from your system.
    ⧼thumbs_response⧽
Advertisement

References

About This Article

Tested by:
wikiHow Technology Team
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 28 people, some anonymous, worked to edit and improve it over time. This article has been viewed 287,813 times.
How helpful is this?
Co-authors: 28
Updated: October 25, 2022
Views: 287,813
Advertisement