System ProgrammingLearn Software Package Management in Red Hat Linux

Learn Software Package Management in Red Hat Linux

Whatever system you are working on: Hardware is the backbone of your system, and Software is considered as the soul of it. Without software, your system will be just a lifeless hardware machine. Software Management includes installing, updating, and removing software packages. This is one of your main tasks as a system administrator. In this article, we will tackle this important topic. So, bring your coffee, and give me your attention.

Software Management
I told you that part of your role as a system admin is to manage the software installation, upgrade, and removal. Red Hat Package Manager RPM is the format that Red Hat software installation files come in. The names of the installation package files end with .rpm.

Besides to Red Hat, many other Linux distributions are said to be RPM-based. The list of RPM-based Linux distros includes: Fedora, CentOS, Mandriva, and OpenSUSE.

The rpm Command
From its manual page:
The rpm command is a powerful package manager, which can be used to build, install, query, verify, update and erase “individual” software packages.

Note that I have quoted the word individual to clarify the fact that rpm mainly works on the package level, whereas other tools we are going to investigate can work on a group of packages.

To install a package:


To upgrade a packages:


To remove a package:


To display all packages installed on the system:
rpm –qa


  • To install the time-1.7-38.el6.i686.rpm package file:

Where –v prints details, and –h prints hashes to show the installation progress.

  • To remove the ntpdate package:


  • To list all installed vim-related packages:

Problems with rpm Command
Of course, noting goes without problems – even minor ones – in this life. Working with the rpm command tool is not that easy all the time. When you decide to install a package using the rpm tool, you need:

  • To obtain or download the package file.
  • To know all the dependencies of this package, obtain, install them.

This may sound easy when the package to install depends on one or two packages. But, what if it depends on twenty or thirty packages? Trying to download, and install the individual packages will be a real burden.

Consider the following case:
The rdesktop package requires as a prerequisite four packages.
Now, consider this:
Got the idea? Great!
So, what is the solution?
YUM has the answer.

The Yellowdog Updater Modified YUM
The YUM tool provides an efficient way to manage the installation, upgrade, and removal of both individual packages and package groups as well. It depends on what is called a software repository. A software repository is simply a directory where software packages are stored. The yum tool refers to one or more of such repositories to list the available packages, install a required package, update a package, or remove it.

The greatest feature of the yum tool is that it takes care of dependencies for you.

Configure YUM Repository
Before using the yum tool, we need to have one or more software repositories for yum to use. We have already configured a repo file that uses the repository located on the Red Hat installation media, earlier in this series. We will do the same job again with more details.
To use a repository we need it to be accessible either locally, via FTP, or HTTP. Our role is to configure a repo file that points at it.
The minimal needed configuration for a repo file are:






baseurl=ftp:// REMOTE-HOST/PATH/To/REPO


Write these lines in a file, and save it as filename.repo under /etc/yum.repo.d directory.

Using the Red Hat Installation ISO Image File as Repository
Using the Installation DVD media as a repository is good option. However, this requires inserting the DVD, and mounting it every time a software package is to be installed or upgraded. If we could have our local copy of the installation source on our hard drive, it will be great alternative to having to physically insert DVD and mount it. This is what we are going to do now. Okay, let’s do it.

  1. Insert the installation DVD.
  2. In your terminal, type the following command:
dd if=/dev/sr0 of=/opt/rhel67.iso

This will copy an image of the installation media to a file called /opt/rhel67.iso
This process should take about 5 minutes.

  1. Now, mount the resulting ISO image file. To do, use the following command:
mount -o loop /opt/rhel67.iso /mnt/

The installation media should now be mounted under /mnt

  1. To make sure the ISO file will be mounted after the system reboots, we need to add the following line to the /etc/fstab file:
/opt/rhel67.iso  /mnt iso9660 loop  0 0

Save and exit the file.

  1. Now, create a new repo file using the vim editor:

vim /etc/yum.repos.d/RHELiso.repo

  1. In the vim editor, type the following lines:


  1. Save and exit the file.

Now, you have your own copy of the Red Hat installation media repository.
Let’s test it:

[[email protected] ~]# yum install -y rdesktop
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'ISOREPO' is missing name in configuration, using id
Repository 'dvd' is missing name in configuration, using id
Setting up Install Process
ISOREPO                                                                                                    | 4.1 kB     00:00 ...
ISOREPO/primary_db                                                                                         | 2.6 MB     00:00 ...
dvd                                                                                                        | 4.1 kB     00:00 ...
Resolving Dependencies
--> Running transaction check
---> Package rdesktop.i686 0:1.7.1-1.el6 will be installed
--> Processing Dependency: for package: rdesktop-1.7.1-1.el6.i686
--> Processing Dependency: for package: rdesktop-1.7.1-1.el6.i686
--> Processing Dependency: for package: rdesktop-1.7.1-1.el6.i686
--> Processing Dependency: pcsc-lite for package: rdesktop-1.7.1-1.el6.i686
--> Running transaction check
---> Package libX11.i686 0:1.6.0-6.el6 will be installed
--> Processing Dependency: libX11-common = 1.6.0-6.el6 for package: libX11-1.6.0-6.el6.i686
--> Processing Dependency: for package: libX11-1.6.0-6.el6.i686
---> Package libao.i686 0:0.8.8-7.1.el6 will be installed
---> Package pcsc-lite.i686 0:1.5.2-15.el6 will be installed
--> Processing Dependency: hal for package: pcsc-lite-1.5.2-15.el6.i686
--> Processing Dependency: for package: pcsc-lite-1.5.2-15.el6.i686
--> Processing Dependency: pcsc-ifd-handler for package: pcsc-lite-1.5.2-15.el6.i686
---> Package pcsc-lite-libs.i686 0:1.5.2-15.el6 will be installed
--> Running transaction check
---> Package hal.i686 0:0.5.14-14.el6 will be installed
--> Processing Dependency: ConsoleKit >= 0.2.0 for package: hal-0.5.14-14.el6.i686
--> Processing Dependency: cryptsetup-luks >= 1.0.1-2 for package: hal-0.5.14-14.el6.i686
--> Processing Dependency: dbus >= 0.90 for package: hal-0.5.14-14.el6.i686
--> Processing Dependency: pm-utils >= 0.10-1 for package: hal-0.5.14-14.el6.i686
--> Processing Dependency: hal-info for package: hal-0.5.14-14.el6.i686
---> Package hal-libs.i686 0:0.5.14-14.el6 will be installed
---> Package libX11-common.noarch 0:1.6.0-6.el6 will be installed
---> Package libxcb.i686 0:1.9.1-3.el6 will be installed
--> Processing Dependency: for package: libxcb-1.9.1-3.el6.i686
---> Package pcsc-lite-openct.i686 0:0.6.19-4.el6 will be installed
--> Processing Dependency: for package: pcsc-lite-openct-0.6.19-4.el6.i686
--> Running transaction check
---> Package ConsoleKit.i686 0:0.4.1-3.el6 will be installed
--> Processing Dependency: for package: ConsoleKit-0.4.1-3.el6.i686
--> Processing Dependency: for package: ConsoleKit-0.4.1-3.el6.i686
---> Package cryptsetup-luks.i686 0:1.2.0-11.el6 will be installed
--> Processing Dependency: cryptsetup-luks-libs = 1.2.0-11.el6 for package: cryptsetup-luks-1.2.0-11.el6.i686
--> Processing Dependency: for package: cryptsetup-luks-1.2.0-11.el6.i686
--> Processing Dependency: for package: cryptsetup-luks-1.2.0-11.el6.i686
---> Package dbus.i686 1:1.2.24-8.el6_6 will be installed
---> Package hal-info.noarch 0:20090716-5.el6 will be installed
---> Package libXau.i686 0:1.0.6-4.el6 will be installed
---> Package openct.i686 0:0.6.19-4.el6 will be installed
--> Processing Dependency: ctapi-common(x86-32) for package: openct-0.6.19-4.el6.i686
--> Processing Dependency: for package: openct-0.6.19-4.el6.i686
---> Package pm-utils.i686 0:1.2.5-11.el6 will be installed
--> Processing Dependency: hdparm for package: pm-utils-1.2.5-11.el6.i686
--> Running transaction check
---> Package ConsoleKit-libs.i686 0:0.4.1-3.el6 will be installed
---> Package cryptsetup-luks-libs.i686 0:1.2.0-11.el6 will be installed
---> Package ctapi-common.i686 0:1.1-6.1.el6 will be installed
---> Package hdparm.i686 0:9.43-4.el6 will be installed
---> Package libtool-ltdl.i686 0:2.2.6-15.5.el6 will be installed
---> Package polkit.i686 0:0.96-11.el6 will be installed
--> Processing Dependency: for package: polkit-0.96-11.el6.i686
--> Running transaction check
---> Package eggdbus.i686 0:0.6-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package                               Arch                    Version                             Repository                Size
 rdesktop                              i686                    1.7.1-1.el6                         ISOREPO                  156 k
Installing for dependencies:
 ConsoleKit                            i686                    0.4.1-3.el6                         ISOREPO                   80 k
 ConsoleKit-libs                       i686                    0.4.1-3.el6                         ISOREPO                   17 k
 cryptsetup-luks                       i686                    1.2.0-11.el6                        ISOREPO                   94 k
 cryptsetup-luks-libs                  i686                    1.2.0-11.el6                        ISOREPO                   52 k
 ctapi-common                          i686                    1.1-6.1.el6                         ISOREPO                  6.3 k
 dbus                                  i686                    1:1.2.24-8.el6_6                    ISOREPO                  211 k
 eggdbus                               i686                    0.6-3.el6                           ISOREPO                   91 k
 hal                                   i686                    0.5.14-14.el6                       ISOREPO                  379 k
 hal-info                              noarch                  20090716-5.el6                      ISOREPO                   56 k
 hal-libs                              i686                    0.5.14-14.el6                       ISOREPO                   68 k
 hdparm                                i686                    9.43-4.el6                          ISOREPO                   82 k
 libX11                                i686                    1.6.0-6.el6                         ISOREPO                  593 k
 libX11-common                         noarch                  1.6.0-6.el6                         ISOREPO                  192 k
 libXau                                i686                    1.0.6-4.el6                         ISOREPO                   24 k
 libao                                 i686                    0.8.8-7.1.el6                       ISOREPO                   36 k
 libtool-ltdl                          i686                    2.2.6-15.5.el6                      ISOREPO                   45 k
 libxcb                                i686                    1.9.1-3.el6                         ISOREPO                  115 k
 openct                                i686                    0.6.19-4.el6                        ISOREPO                  211 k
 pcsc-lite                             i686                    1.5.2-15.el6                        ISOREPO                  129 k
 pcsc-lite-libs                        i686                    1.5.2-15.el6                        ISOREPO                   27 k
 pcsc-lite-openct                      i686                    0.6.19-4.el6                        ISOREPO                   15 k
 pm-utils                              i686                    1.2.5-11.el6                        ISOREPO                  109 k
 polkit                                i686                    0.96-11.el6                         ISOREPO                  161 k

Transaction Summary
Install      24 Package(s)

Total download size: 2.9 M
Installed size: 9.1 M
Downloading Packages:
Total                                                                                             5.4 MB/s | 2.9 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : 1:dbus-1.2.24-8.el6_6.i686                                                                                    1/24
  Installing : hal-libs-0.5.14-14.el6.i686                                                                                   2/24
  Installing : pcsc-lite-libs-1.5.2-15.el6.i686                                                                              3/24
  Installing : libao-0.8.8-7.1.el6.i686                                                                                      4/24
  Installing : ctapi-common-1.1-6.1.el6.i686                                                                                 5/24
  Installing : libX11-common-1.6.0-6.el6.noarch                                                                              6/24
  Installing : ConsoleKit-libs-0.4.1-3.el6.i686                                                                              7/24
  Installing : eggdbus-0.6-3.el6.i686                                                                                        8/24
  Installing : ConsoleKit-0.4.1-3.el6.i686                                                                                   9/24
  Installing : polkit-0.96-11.el6.i686                                                                                      10/24
  Installing : libXau-1.0.6-4.el6.i686                                                                                      11/24
  Installing : libxcb-1.9.1-3.el6.i686                                                                                      12/24
  Installing : libX11-1.6.0-6.el6.i686                                                                                      13/24
  Installing : hdparm-9.43-4.el6.i686                                                                                       14/24
  Installing : libtool-ltdl-2.2.6-15.5.el6.i686                                                                             15/24
  Installing : openct-0.6.19-4.el6.i686                                                                                     16/24
  Installing : cryptsetup-luks-libs-1.2.0-11.el6.i686                                                                       17/24
  Installing : cryptsetup-luks-1.2.0-11.el6.i686                                                                            18/24
  Installing : pm-utils-1.2.5-11.el6.i686                                                                                   19/24
  Installing : hal-info-20090716-5.el6.noarch                                                                               20/24
  Installing : hal-0.5.14-14.el6.i686                                                                                       21/24
  Installing : pcsc-lite-1.5.2-15.el6.i686                                                                                  22/24
  Installing : pcsc-lite-openct-0.6.19-4.el6.i686                                                                           23/24
  Installing : rdesktop-1.7.1-1.el6.i686                                                                                    24/24
ISOREPO/productid                                                                                          | 1.6 kB     00:00 ...
  Verifying  : polkit-0.96-11.el6.i686                                                                                       1/24
  Verifying  : cryptsetup-luks-libs-1.2.0-11.el6.i686                                                                        2/24
  Verifying  : pm-utils-1.2.5-11.el6.i686                                                                                    3/24
  Verifying  : libtool-ltdl-2.2.6-15.5.el6.i686                                                                              4/24
  Verifying  : 1:dbus-1.2.24-8.el6_6.i686                                                                                    5/24
  Verifying  : hdparm-9.43-4.el6.i686                                                                                        6/24
  Verifying  : libxcb-1.9.1-3.el6.i686                                                                                       7/24
  Verifying  : libX11-1.6.0-6.el6.i686                                                                                       8/24
  Verifying  : rdesktop-1.7.1-1.el6.i686                                                                                     9/24
  Verifying  : ConsoleKit-libs-0.4.1-3.el6.i686                                                                             10/24
  Verifying  : openct-0.6.19-4.el6.i686                                                                                     11/24
  Verifying  : hal-info-20090716-5.el6.noarch                                                                               12/24
  Verifying  : libXau-1.0.6-4.el6.i686                                                                                      13/24
  Verifying  : pcsc-lite-openct-0.6.19-4.el6.i686                                                                           14/24
  Verifying  : eggdbus-0.6-3.el6.i686                                                                                       15/24
  Verifying  : cryptsetup-luks-1.2.0-11.el6.i686                                                                            16/24
  Verifying  : pcsc-lite-libs-1.5.2-15.el6.i686                                                                             17/24
  Verifying  : libX11-common-1.6.0-6.el6.noarch                                                                             18/24
  Verifying  : ctapi-common-1.1-6.1.el6.i686                                                                                19/24
  Verifying  : libao-0.8.8-7.1.el6.i686                                                                                     20/24
  Verifying  : pcsc-lite-1.5.2-15.el6.i686                                                                                  21/24
  Verifying  : hal-libs-0.5.14-14.el6.i686                                                                                  22/24
  Verifying  : hal-0.5.14-14.el6.i686                                                                                       23/24
  Verifying  : ConsoleKit-0.4.1-3.el6.i686                                                                                  24/24

  rdesktop.i686 0:1.7.1-1.el6

Dependency Installed:
  ConsoleKit.i686 0:0.4.1-3.el6                 ConsoleKit-libs.i686 0:0.4.1-3.el6      cryptsetup-luks.i686 0:1.2.0-11.el6
  cryptsetup-luks-libs.i686 0:1.2.0-11.el6      ctapi-common.i686 0:1.1-6.1.el6         dbus.i686 1:1.2.24-8.el6_6
  eggdbus.i686 0:0.6-3.el6                      hal.i686 0:0.5.14-14.el6                hal-info.noarch 0:20090716-5.el6
  hal-libs.i686 0:0.5.14-14.el6                 hdparm.i686 0:9.43-4.el6                libX11.i686 0:1.6.0-6.el6
  libX11-common.noarch 0:1.6.0-6.el6            libXau.i686 0:1.0.6-4.el6               libao.i686 0:0.8.8-7.1.el6
  libtool-ltdl.i686 0:2.2.6-15.5.el6            libxcb.i686 0:1.9.1-3.el6               openct.i686 0:0.6.19-4.el6
  pcsc-lite.i686 0:1.5.2-15.el6                 pcsc-lite-libs.i686 0:1.5.2-15.el6      pcsc-lite-openct.i686 0:0.6.19-4.el6
  pm-utils.i686 0:1.2.5-11.el6                  polkit.i686 0:0.96-11.el6

[[email protected] ~]#

Do you remember what did we get when we try to install the same package rdesktop using the rpm command? We got a list of missing software packages needed as prerequisites to installing rdesktop.

But, with yum, the great tool has taken care of all this for you.

Now, let’s see the Syntax of the yum command.

That will be in the next article. See you.



Please enter your comment!
Please enter your name here

Exclusive content

- Advertisement -Newspaper WordPress Theme

Latest article


More article

- Advertisement -Newspaper WordPress Theme