Use YUM and RPM Package Managers on AlmaLinux 8 – Easy Guide

Share your love

In this section of the Linux Tutorials, we want to teach you How To Use YUM and RPM Package Managers on AlmaLinux 8.

YUM and RPM are package management tools for installing, updating, removing, and managing software packages in the RedHat-based Linux system.

In this article about the Differences between YUM and DNF package managers, we discussed why using DNF on Centos 8 and AlmaLinux 8 is better. Still, you may want to use YUM so stay with us for the rest of the article.

Steps to Use YUM and RPM Package Managers on AlmaLinux 8

To use YUM and RPM Package Managers on AlmaLinux 8, you need to log in to your server as a non-root user with sudo privileges to execute the root commands. you can check our article about the Initial server setup with AlmaLinux 8.

Now we start to teach you how to use YUM and RPM on AlmaLinux 8.

Note: You can use this guide for Centos 8 and some RedHat-based Linux systems.

Use YUM and RPM Package Managers on AlmaLinux 8

How To Enable Epel-repository on AlmaLinux 8

The EPEL repository is an additional package repository that provides easy access to install packages for commonly used software.

You can install the Epel-repository on AlmaLinux 8 with the following command:

sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Accept the installation with ‘Y’ or you can use the ‘-y’ option for the yum package manager on AlmaLinux 8 in your command to answer yes.

Your output should be similar to this:

OutPut
Last metadata expiration check: 1:38:32 ago on Wed 08 Sep 2021 12:35:34 AM EDT.
epel-release-latest-8.noarch.rpm 34 kB/s | 23 kB 00:00
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Installing:
epel-release noarch 8-11.el8 @commandline 23 k
Transaction Summary
================================================================================
Install 1 Package
Total size: 23 k
Installed size: 35 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : epel-release-8-11.el8.noarch 1/1
Running scriptlet: epel-release-8-11.el8.noarch 1/1
Verifying : epel-release-8-11.el8.noarch 1/1
Installed:
epel-release-8-11.el8.noarch
Complete!

List Current Repositories on AlmaLinux 8

Here you can list current repositories on AlmaLinux 8 with the following command:

sudo yum repolist

In your output you will see:

Output
repo id repo name
appstream AlmaLinux 8 - AppStream
baseos AlmaLinux 8 - BaseOS
epel Extra Packages for Enterprise Linux 8 - x86_64
epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64
extras AlmaLinux 8 - Extras

There are many available options and commands to use with the YUM package manager on AlmaLinux 8. Let’s check them.

How to Use YUM Package Manager on AlmaLinux 8

You can easily use YUM on AlmaLinux 8 at the command line in this form:

yum -option command

Here are some useful commands for the YUM package manager on AlmaLinux 8:

  1. yum-install: It will install the specified packages.
  2. yum-remove: Removes the specified packages.
  3. yum-search: This will search metadata for keywords.
  4. yum-info: It lists the descriptions.
  5. yum-update: With this command, you can update the packages to the latest version.
  6. yum-repolist: As you saw in the previous part, it will list the current repositories.
  7. yum-history: This shows what has happened in past transactions.

For example:

yum history
Output
ID | Command line | Date and time | Action(s) | Altered
--------------------------------------------------------------------------------
6 | install https://dl.fedora | 2021-09-08 02:14 | Install | 1
5 | install httpd | 2021-09-07 02:12 | Install | 9
4 | update | 2021-09-07 02:08 | E, I, U | 68
3 | update -y | 2021-06-25 07:06 | I, U | 273 EE
2 | update -y | 2021-03-30 23:47 | I, U | 7 EE
1 | | 2021-03-30 23:00 | Install | 494 EE

This will bring you some useful information about what you did.

Here are some useful options for the YUM package manager on AlmaLinux 8:

  1. -C: Runs from the system cache.
  2. –security: Includes packages that provide a fix for security.
  3. -y: Answers yes to questions.
  4. –skip-broken: Skips packages causing problems.
  5. -v: It is used for verbose.

For example:

yum install -y nginx

This will answer yes to all questions and complete your installation.

For more information and options in detail, you can use this command:

man yum

Let’s see how the RPM package manager works.

How to Use RPM on AlmaLinux 8

The form of using RPM is like this:

rpm mode package-file

RPM package manager on AlmaLinux 8 has some basic modes like verify, install, upgrade, etc.

Here are some useful modes for RPM package manager on AlmaLinux 8:

  1. -i: It will install a package.
  2. -U: This upgrades a package.
  3. -e: Erases a package.
  4. -V: This mode verifies a package.
  5. -q: Queries a package.

Here are some useful options for RPM package manager on AlmaLinux 8:

  1. -?|–help: This will print help.
  2. –version: This will print the version number.
  3. -v: Prints verbose output.

For example:

rpm -qa nginx
Output
nginx-1.14.1-9.module_el8.3.0+2165+af250afe.alma.x86_64

Here option “a” queries all installed packages on the system.

You can erase the package like:

rpm -evh nginx

-h option is for the hash that shows the # as a progress bar for the operation.

Also, you can use this command for more details about the RPM package manager on AlmaLinux 8:

man rpm

Conclusion

At this point, you have learned to use YUM and RPM package managers on AlmaLinux 8. Also, you get familiar with their commands and options. Using these package managers provides flexibility in managing software packages. YUM simplifies installations with automatic dependency resolution, while RPM offers more control over individual package management.

Hope you enjoy it. You may also like the following articles:

Secure Alpine Linux Using CSF Firewall

AlmaLinux 9 vs Ubuntu 24 Server

Install Nvidia Drivers on AlmaLinux 8

FAQs

What is the difference between YUM and RPM on AlmaLinux?

YUM handles automatic dependencies, while RPM allows manual installation, verification, and removal of packages.

How can I list installed packages with YUM?

You can use the command yum list installed.

How do I install a package using RPM?

You can use rpm -ivh package_name.rpm.

Can I update a package with YUM?

Yes, the command is yum update package_name.

Newsletter Updates

Enter your email address below and subscribe to our newsletter

4 Comments

  1. Can I simply say what a relief to find somebody who actually is aware of what they’re speaking about on the internet. You undoubtedly know find out how to convey an issue to light and make it important. More individuals need to read this and perceive this side of the story. I cant consider you’re not more standard because you undoubtedly have the gift.

Leave a Reply

Stay informed and not overwhelmed, subscribe now!