A Linux distro can be described as a collection of inter-dependent packages on top of the Linux kernel. Together, they offer an amazing experience. To keep the packages in order, a package manager is a must-have for every distro.

In the case of Fedora, YUM and DNF are two package managers. In this guide, we’ll check out how to set up and use YUM on Fedora.

YUM on Fedora

YUM is the primary package manager for Fedora that can query info about packages, fetch packages from repos, install/uninstall packages with automatic dependency solution, and update the entire system. YUM can also work with additional repos or package sources. To extend the functionality, YUM also supports many plugins.

YUM can perform the same tasks as RPM but in a more efficient and simpler manner. It also simplifies configuring your own repositories and RPM packages.

In the modern-day, YUM is being replaced by DNF, a modern-day package manager. It’s because YUM has some inherent issues like poor performance, high memory consumption, poor documentation, etc. However, it’s still worth learning YUM because Fedora, CentOS, and RHEL still support YUM as a valid package manager.

Installing YUM on Fedora

As one of the default package managers, YUM should come pre-installed with Fedora. Run the following commands to verify if YUM is installed:

$ which yum

$ yum –version

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image1-47.png" data-lazy- height="307" src="data:image/svg xml,” width=”1366″>

If YUM isn’t installed, then the following command will install YUM right away.

Using YUM

It’s time to learn how to use YUM– a full-fledged package manager with tons of features. This section demonstrates some of its most common and important commands.

Installing a package

To install a package, YUM requires the package name. Assuming you have the package name, run the following command to install it. YUM will automatically resolve and install all the necessary dependencies.

$ sudo yum install <package_name>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image3-42.png" data-lazy- height="503" src="data:image/svg xml,” width=”1366″>

If there needs to install multiple packages, then just place all the package names separated by space.

$ sudo yum install <package_1> <package_2>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image2-45.png" data-lazy- height="604" src="data:image/svg xml,” width=”1366″>

When installing any package, YUM will ask for confirmation. If you want YUM to install the packages without asking any permission, then use the “-y” flag.

$ sudo yum -y install <package_1> <package_2>

Install an RPM package

Various packages are directly available as RPM packages. While the default method of installing an RPM package is using the RPM tool, it’s recommended to use YUM to do so. If installed using YUM, the RPM package will be installed with all its dependencies (if available).

$ sudo yum install <rpm_package_path>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image5-32.png" data-lazy- height="454" src="data:image/svg xml,” width=”1366″>

If there are multiple packages, then mention those as well.

$ sudo yum install <rpm_package_1> <rpm_package_2>

It’s also possible to install an RPM package that’s available through a direct link. In the following example, YUM will download and install the RPM Fusion repo.

$ sudo yum install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image4-37.png" data-lazy- height="581" src="data:image/svg xml,” width=”1366″>

Removing a package

When a package is no longer needed, keeping it installed is redundant. To remove an unwanted package, use the following command structure:

$ sudo yum remove <package_name>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image7-24.png" data-lazy- height="415" src="data:image/svg xml,” width=”1366″>

YUM will ask for permission to perform the action. If you want YUM to not ask for permission, use the “-y” flag.

$ sudo yum -y remove <package_name>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image6-30.png" data-lazy- height="622" src="data:image/svg xml,” width=”1366″>

Same as installing multiple packages, YUM can also remove multiple packages.

$ sudo yum remove <package_1> <package_2>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image10-20.png" data-lazy- height="529" src="data:image/svg xml,” width=”1366″>

Searching a package

In many situations, the exact package name for a certain app is hard to keep track of. In such situations, the built-in searching feature of YUM comes really handy.

To search for a certain package name with a search term, use the following command structure:

$ yum search <search_term>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image8-25.png" data-lazy- height="574" src="data:image/svg xml,” width=”1366″>

Updating a package

If there’s an update available for a certain package, it’s possible to individually update the package. By default, YUM will download and install the latest version of the package with dependencies.

$ sudo yum update <package_name>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image14-16.png" data-lazy- height="529" src="data:image/svg xml,” width=”1366″>

Updating system

Instead of updating individual packages, it’s more efficient to let YUM update the entire system. YUM will check and download all the available updates and install them accordingly.

First, check if there’s any update available.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image11-20.png" data-lazy- height="281" src="data:image/svg xml,” width=”1366″>

If there’s any update available, the following command will install all of them:

List packages

Using the “list” function, YUM can print all the list of packages, installed or available. This function can also search for an available package with a specific name.

To list all the installed packages, run the following command. The output will be huge, so we’ll be piping the output to “less” for easier browsing.

$ yum list installed | less

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image13-16.png" data-lazy- height="629" src="data:image/svg xml,” width=”1366″>

To list all the matching packages with a specific search term, use the following command:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image15-15.png" data-lazy- height="285" src="data:image/svg xml,” width=”1366″>

To list all the packages (installed and available), run the following command:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image16-12.png" data-lazy- height="629" src="data:image/svg xml,” width=”1366″>

Information about a package

Before installation, YUM can show detailed info about a package, and it can be helpful in various situations. To check info about a package, run the following YUM command:

$ yum info <package_name>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image17-11.png" data-lazy- height="505" src="data:image/svg xml,” width=”1366″>

Group packages

In Linux, a group is a bundle of a number of packages. A group will generally contain packages that are related to each other. For example, the group “Java Development” contains all the necessary tools for developing programs in the Java programming language.

The following command will list all the available groups.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image18-10.png" data-lazy- height="624" src="data:image/svg xml,” width=”1366″>

To check the information about a group, run the following command:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image19-8.png" data-lazy- height="599" src="data:image/svg xml,” width=”1366″>

To install a group, run the following command:

$ sudo yum groupinstall <group>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image20-9.png" data-lazy- height="576" src="data:image/svg xml,” width=”1366″>

If a group is to be updated, run the following command:

$ sudo yum groupupdate <group>

To uninstall a group, run the following command:

$ sudo yum groupremove <group>

Repositories

YUM repositories are the primary sources for downloading and installing packages. Fedora comes with the Fedora repos by default. However, it’s possible to add/remove additional repositories.

First, check out all the currently active repositories.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image21-7.png" data-lazy- height="256" src="data:image/svg xml,” width=”1366″>

If there are some disabled repos, those won’t show on this list. To list all the repositories, run the following command:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image22-8.png" data-lazy- height="521" src="data:image/svg xml,” width=”1366″>

To install a specific package from a specific repo, use the flag “–enablerepo”. It works on both enabled or disabled repo.

$ sudo yum –enablerepo=<repo> install <package>

Cleaning up YUM

YUM generates all the repo package data in the “/var/cache/yum” location; each repo with its own sub-directory. While the cache is important for YUM to provide the fastest possible performance, a corrupted cache may be a problem, and cleaning it up will solve the issue.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image9-23.png" data-lazy- height="131" src="data:image/svg xml,” width=”1366″>

Now, perform a system update. YUM will automatically generate the caches again.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image12-17.png" data-lazy- height="279" src="data:image/svg xml,” width=”1366″>

Final thoughts

YUM is a powerful package manager. This guide demonstrates some of the most common usages of YUM. For quick help, check out the YUM help page.

For in-depth information about YUM, the man page is quite useful.

Happy computing!

About the author

<img alt="Sidratul Muntaha" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/profile-photo-1-150×150.jpg" height="112" src="data:image/svg xml,” width=”112″>

Sidratul Muntaha

Student of CSE. I love Linux and playing with tech and gadgets. I use both Ubuntu and Linux Mint.