CompTIA Linux+ (XK0-004)
Red Hat Enterprise Linux
Git and Github
Learn Docker and Kubernates
Tips and Tricks

4. Installing Software with RPM

  • Installing software with RPM

  • Querying packages

  • Removing packages with RPM

  • What's dependency hell?

Points to remember:

  • RPM is a binary file like .exe in Windows.

  • RPM is a package manager. And, it is very low-level.

  • It doesn't resolve dependencies, you must install them manually.

  • Yum takes away all the dependencies problem and is the way forward. However, a lot of times, you query packages using the rpm command.

Commands:

‚Äč

Mode

Description

-i

Installs a package

-U

Upgrades a package

-e

Erases a package

-V

Verifies a package

-q

Queries a package

-a

queries all installed packages on the system

Here are some commonly-used general options:

General options

Purpose

-? | --help

Prints help

--version

Prints version number

-v

Prints verbose output

yum comes with yumdownloader that lets you download RPM packages but doesn't install them automatically.

yumdownloader nmap-> this downloads the package from the internet and save it in the current directory. However, it doesn't install it.

Downloaded the Nmap packages using yumdownloader

There are two ways to install a package:

  • rpm -U -> It upgrades the package if it is there. Otherwise, it installs it.

  • rpm -i -> It only installs the package. This option doesn't override the installed package if one is already there because it can become problematic at times.

Installing a package:

Installing a package

Removing a package:

Removing a package

Query installed package on the system:

rpm -qa
query all installed packages

Check which package has installed certain program:

Imagine you want to know which package has installed nmap in the system. I can do: rpm -qf `which nmap`

You can display more information about an installed package: