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

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

Download Article
  1. How.com.vn English: Step 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:[1]
    • 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. How.com.vn English: Step 2 Install the RPM package.
    Once downloaded, you have two options:[2]
    • 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 2
Method 2 of 3:

Removal

Download Article
  1. How.com.vn English: Step 1 Open a terminal window, and type:
    rpm -e *package_name*. Do not type the extension on the file.[3] For example: rpm -e gedit
Method 3
Method 3 of 3:

Helpful RPM Flags

Download Article
  1. How.com.vn English: Step 1 The rpm -i command syntax is listed below.
  2. How.com.vn English: Step 2 Install-specific options:
    [4]
    • -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. How.com.vn English: Step 3 General Options.
    [5]
    • -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

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Video

      Tips

      • Rarely, you will need to force an installation. To do this, pass the --force argument to the rpm command. - This will only work on the command line.
      • Using the parameter -U (update) instead of -i (install) guarantees that you install the latest version of the RPM.
      • Some packages will have dependencies. All this means is that you must install another package for the desired one to work. An example of this is Ogle, an open-source DVD player. On its own, Ogle can't play a DVD, but requires a few other programs to be installed, in addition to the main Ogle package. If the rpm has dependencies and you don't care about satisfying them you can use the --nodeps option as well.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      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.
      Advertisement

      About This Article

      Tested by:
      How.com.vn Technology Team
      How.com.vn is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 29 people, some anonymous, worked to edit and improve it over time. This article has been viewed 322,661 times.
      How helpful is this?
      Co-authors: 29
      Updated: February 12, 2024
      Views: 322,661
      Thanks to all authors for creating a page that has been read 322,661 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement