YUM Repository Management

This article is focused toward Linux YUM repository management and you will learn how to install, update, remove, find packages, manage packages and repositories. 

What is YUM?

Every operating system needs some specific software/drivers/packages to perform specific tasks. You want to use scanner on your windows machine, you need to install scanner drivers. The same way drivers are known as packages on Unix / Linux operating systems.

More specifically, packages are called as RPM (RedHat Package Manager)

RedHat created a central location (on cloud) for all the RedHat Linux related packages and this central location is known as YUM repository. 

This helps in simplification of package distribution for all RedHat based Linux systems: CentOS, Red Hat Linux, Oracle Enterprise Linux etc.

Any company wants to update or release a new package, they push it to YUM repository. Any user who wants to download or update packages, they can connect to YUM repository and get RPMs.

Benefits on YUM

  • You can easily search for any packages under YUM repository
  • You can download and install packages (RPMs) from YUM repository
  • You can update, delete and easily manage RPMs on your Linux system
  • If one RPM is dependent on another RPM, it will auto install both RPMs
  • YUM is officially managed by Red Hat

Install package from YUM

Let’s take you want to install firefox on your Linux system, then use below command to install it

yum -y install firefox

-y confirms yum to install firefox directly without asking for your confirmation. If you remove -y from above command, yum will prompt you for yes/no to proceed further.

Removing a package

Now let’s try to remove firefox from our Linux system

yum -y remove firefox

List a package in YUM

Let’s take you want to search a specific package inside YUM repository and check for all the packages where name start with oracle

yum list oracle*

Search a package in YUM

Sometimes you might not remember the exact package name. In this case, use search option to find a specific packages

yum search gcc

Get info about package

Yum allows you to check package information even before installing it

yum info gcc

List all packages inside YUM

To list all the packages inside yum database, use below command

yum list all | less

List all installed packages

To see all the packages that are installed on a Linux system, use below command

yum list installed | less

Check package updates

To find how many of installed packages on your system have updates available, to check use the following command

yum check-update

Update System using YUM

To keep your system up-to-date with all security and binary package updates, run the following command. It will install all latest patches and security updates to your system

yum update

Clean YUM cache

By default when you connect to YUM repository and install packages, it stores repository cache on your Linux system. This takes hard disk space and you must clean it from time to time

yum clean all

View YUM history

To view all the past transactions of yum command, just use the following command

yum history

Scenarios

There are different scenarios that you might encounter while working with YUM repository. In such case, read below to find and fix the issues.

How to find your system architecture

Use the Linux arch command to get the system architecture. Below command will show you if your system is 32 bit or 64 bit

arch

Was this article helpful?

Related Articles

Leave a Comment