Linux: Managing RPM Packages with YUM
Tags: linux, bash, devops, writing
Published: 2022-07-19 20:21:23

## Intro
Package managers for Linux are basically tools or software applications that allows users to install, uninstall, update, configure and manage software packages on Linux. There are various [package managers](https://www.digitalocean.com/community/tutorials/package-management-basics-apt-yum-dnf-pkg) for Linux. However, this article will focus on YUM.

### Target audience
This article assumes you have basic or intermediate knowledge of [Linux](https://www.geeksforgeeks.org/interesting-facts-about-linux/), [RPM](https://linuxize.com/post/rpm-command-in-linux/) and/or navigating the [Linux CLI](https://ubuntu.com/tutorials/command-line-for-beginners), If you have no previous knowledge of these topics, I recommend you read them prior to reading this.

### What you'll learn
This article focuses on an intermediate topic in Linux system administration. After reading through, you are expected to understand:
- What is YUM and how to install it
- Difference between YUM and RPM
- Managing software with the YUM command

### What you'll need
- A computer running Fedora or some other version of Red Hat-based Linux


### What is YUM and how to install it

The YellowDog Updater Modified(YUM) is a command line package management utility for the Linux operating system, it is used for managing Linux RPM software packages. 

While there are differences between YUM and RPM, YUM still uses the RPM package format.

Look at what Wikipedia have to say:
> Under the hood, YUM depends on RPM, which is a packaging standard for digital distribution of software, which automatically uses hashes and digital signatures to verify the authorship and integrity of said software.

Yum evolved from Yellowdog Updater(YUP). YUP was created between 1999-2001 to serve as a back-end engine for Linux's graphical installer. 

Now that you know a little history of yum, let's get down to using it. Fedora should come pre-installed with YUM as a default package, run the following command to confirm if YUM is installed.
 
```bash
which yum
``` 

but just in case you don't have YUM installed on your system, you can install it with...

```bash
sudo dnf install yum
``` 
Now type in the previous command to confirm if yum is installed. Before diving deeper into using the YUM package manager, get a grasp of the similarities and differences between YUM and RPM.

### Difference between YUM and RPM

Both YUM and RPM are package managers, the biggest drawback for RPM is that it cannot resolve package dependencies, for this amongst many other reasons YUM was created. 

It varies differently from RPM in various ways, to mention a few:

- YUM resolves package dependencies automatically 
- It can install multiple versions of a package
- It automatically upgrades packages
- With YUM, you can go back to previous versions of a package

### Package management with YUM
``yum help`` - Displays list of YUM commands and options
``yum install <package_name>`` - Installs whatever package name was given in the command.
``yum update`` - Updates the package
``yum downgrade`` - Returns the package to an earlier version
``yum remove`` - Removes the package and it's dependencies
``yum info`` - Displays information about the package.
``yum list`` - List package names

### Conclusion

By reading this article, you should have learnt about YUM package manager, how to use it and it's common commands. I urge you actively run the commands yourself, to make sure the learning sticks.

However, YUM has been replaced with Dandified YUM(DNF), which means YUM is no more the primary package manager in Fedora. For more information on DNF check out the following articles:

- [Using the DNF Package Manager](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjF45mX2oT5AhXHxqQKHWPADksQFnoECAMQAw&url=https%3A%2F%2Fdocs.fedoraproject.org%2Fen-US%2Fquick-docs%2Fdnf%2F&usg=AOvVaw1ogY33WCDUXpkky0sp_TNa)
- [A Quick Guide to DNF for YUM users](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwjF45mX2oT5AhXHxqQKHWPADksQFnoECB0QAQ&url=https%3A%2F%2Fopensource.com%2Farticle%2F18%2F8%2Fguide-yum-dnf&usg=AOvVaw22K8sVuIsisLCizE7avdfk)
- [Using DNF to Manage Packages in CentOS/RHEL 8 and Fedora](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiijc6KgYX5AhUY_hoKHXf2CnQQFnoECAcQAQ&url=https%3A%2F%2Fwww.linode.com%2Fdocs%2Fguides%2Fdnf-package-manager%2F&usg=AOvVaw1O-BM-vCocbYqr71W4312x)