How To Install RPM Packages Using YUM

Install RPM Packages Using YUM
Install RPM Packages Using YUM.

Introduction

YUM is the command line software used to install the software within CentOS and Fedora. If you would prefer a more graphic solution choose the YUM Extender instead. YUM is to CentOs and Fedora what apt-get is to Debian and Ubuntu.

Have you ever wondered what YUM stands for? Reading the manual page states that YUM stands for "Yellowdog Updater Modified". YUM is the successor to the YUP tool which was the default package manager in Yellowdog Linux.

How To Install RPM Packages Using YUM

To install an RPM package simply enter the following command:

yum install nameofpackage

For example:

yum install scribus

How To Update Packages Using YUM

If you want to update all the packages on your system simply run the following command:

yum update

To update a specific package or packages try the following:

yum update nameofpackage

If you want to update a package to a specific version number you need to use the update-to command as follows:

yum update-to nameofpackage versionnumber

For example:

yum update-to flash-plugin 11.2.202-540-release

Now think about this situation. You have version 1.0 of a program and there are a number of bug fixes 1.1, 1.2, 1.3 etc. Also available is version 2 of the software. Now imagine you want to install the bug fixes but not move to the new version because quite frankly it sucks. So how do you update without upgrading?

Simply use the update-minimal command as follows:

yum update-minimal programname --bugfix

How To Check For Updates Using YUM Without Installing Them

Sometimes you want to know what needs updating before actually performing the update.

The following command will return a list of programs that need updating:

yum check-updates

How To Remove Programs Using YUM

If you want to remove an application from your Linux system then you can use the following command:

yum remove programname

Removing programs from your system might seem straight forward but by removing one application you may prevent another one from working.

For instance, imagine you had a program that monitors a folder and if it finds a file the program sends you an email letting you know there is a new file. Imagine that this program requires an email service to actually send the email. If you delete the email service the program that monitors the folder will be rendered useless.

To remove programs that are dependent upon the program you are removing using the following command:

yum autoremove programname

In the instance of the monitoring program and the email service, both applications would be removed.

The auto remove command can also be used without any parameters, as follows:

yum autoremove

This searches your system for files that weren't explicitly installed by you and which have no dependencies. These are known as leaf packages.

List All The RPM Packages Available Using YUM

You can list all of the available packages within YUM simply by using the following command:

yum list

There are extra parameters that you can add to list to make it more useful.

For instance to list all the available updates on your system run the following command:

yum list updates

To see all the packages that are installed, on your system run the following command:

yum list installed

You can list all of the files that were installed without the use of repositories by running the following command:

yum list extras

How To Search For RPM Packages Using YUM

To search for a specific package use the following command:

yum search programname|description

For instance to search for Steam use the following command:

yum search steam

Alternatively, search for a particular type of application as follows:

yum search "screen capture"

By default the search facility looks in the package names and summaries and only if it doesn't find results will it search descriptions and URLs.

To get yum to search descriptions and URLs as well use the following command:

yum search "screen capture" all

How To Get Information About RPM Packages Using YUM

You can retrieve important information about a package by using the following command:

yum info packagename

The information returned is as follows:

  • Name
  • Architecture
  • Version
  • Release
  • Size
  • Repository
  • Summary
  • URL
  • License
  • Description

How To Install Groups Of Applications Using YUM

To return a list of groups using YUM run the following command:

yum group list | more

The output returned from this command is similar to the following:

You can, therefore, install the KDE Plasma desktop environment using the following command:

yum group install "KDE Plasma workspaces"

Before you do that though you might wish to find out what packages make up the group. To do this run the following command:

yum group info "KDE Plasma workspaces" | more

You will notice that when you run this command you will see a list of groups within groups. You can, of course, run the group info on these groups as well.

How To Install RPM Files Local To Your System Using YUM

What happens if the RPM file isn't going to be installed from one of the repositories set up on your system. Perhaps you have written your own package and you want to install it.

To install an RPM package local to your system run the following command:

yum localinstall filename

If the file requires dependencies then the repositories will be searched for the dependencies.

How To Reinstall An RPM Package Using YUM

If you have been unlucky and a program that was once working for whatever reason has stopped working you can reinstall it again by using the following command:

yum reinstall programname

This command will reinstall the same program with the same version number as the one already installed.

How To List All The Dependencies For An RPM Package

To list all of the dependencies for a package use the following command:

yum deplist programname

For example to find all of the dependencies of Firefox use this:

yum deplist firefox

How To List All The Repositories Used By YUM

To find out which repositories are available on your system to use the following command:

yum repolist

The returned information will be as follows:

  • repository id - I.E. epel/x86_64
  • repository name - I.E. extra packages for enterprise Linux 7
  • status - number of packages in repository

This guide gives a good overall indication as to how YUM works. However, it only scratches the surface of all the possible usages of YUM. For full information including listing all the possible switches run the following command:

man yum