How To Install Yum in Linux?

Introduction -:

How To Install Yum in Linux
Image by Freepik

Welcome guys, Here we are learning the installation of the one of the most useful utility in linux, called as “YUM (Yellowdog Updater, Modified). Also you may learn the basic things about the linux into our blog “TechStudy24By7“.

Here are some key points about YUM and how it works:

  1. Package Management: YUM is used to manage software packages on a Linux system. A package is a collection of software files, configurations, and metadata needed to install and run a specific application or library.
  2. Repository: YUM uses software repositories to store and organize packages. A repository is a centralized location where packages and their associated metadata are made available for installation and updates. YUM can be configured to use multiple repositories, which provide access to a wide range of software packages.
  3. Dependency Resolution: One of YUM’s main strengths is its ability to handle package dependencies automatically. When you request the installation of a package, YUM will also identify and install any other packages required by the requested package to ensure it functions correctly.
  4. Commands: YUM can be accessed through the command-line interface (CLI) in the terminal. Some commonly used YUM commands include:
    • yum install package_name: Installs a package.
    • yum update package_name: Updates a package to the latest available version.
    • yum remove package_name: Uninstalls a package from the system.
    • yum search keyword: Searches for packages based on a keyword.
    • yum list: Lists all installed packages.
    • yum info package_name: Displays detailed information about a package.
  5. Repositories Configuration: YUM’s main configuration file is located at /etc/yum.conf. Repository configurations are stored in separate .repo files in the /etc/yum.repos.d/ directory. Each .repo file defines a repository, including its name, base URL, enabled status, and other options.
  6. Package Caching: YUM caches the downloaded packages in the system to reduce the download time and bandwidth usage for future installations or updates.
  7. Security and GPG Key: YUM uses GPG (GNU Privacy Guard) signatures to verify the integrity and authenticity of the packages downloaded from repositories, ensuring that the packages have not been tampered with.
  8. Graphical Frontends: In addition to the command-line interface, YUM also has graphical frontends like dnfdragora and yumex, which provide a more user-friendly and visual way to manage packages.

In Linux, “yum” is a package manager used primarily in Red Hat-based distributions, such as CentOS and Fedora. However, it is being gradually replaced by “dnf” (Dandified Yum) in newer versions of these distributions. If you are using an older version that still uses yum, you can install it by following these steps:

Check if yum is already installed -:

To check if yum is already installed on your system, open a terminal and run the following command:

$ yum --version 

If yum is already installed, you’ll see its version information. Otherwise, you will receive an error message indicating that the command is not found.

Install yum -:

If yum is not installed on your system, you can install it using the package manager specific to your distribution.

For CentOS 7 and earlier, use the following command:

$ sudo yum install yum 

For Fedora and CentOS 8, “dnf” is the default package manager, but you can still install yum using dnf:

$ sudo dnf install yum 

Follow the prompts to confirm the installation, and the package manager will download and install yum on your system.

Verify the installation –:

After the installation is complete, you can check the version of yum to ensure it’s installed correctly:

$ yum --version 

You should now see the version information for yum.

yum-install

As mentioned earlier, if you are using the latest versions of CentOS or Fedora, “dnf” is the recommended package manager. Yum has been largely replaced by dnf, which offers better performance and additional features. For example, on CentOS 8, you can directly use “dnf” without installing yum.

Difference -: YUM & DNF

FeatureYUM (Yellowdog Updater, Modified)DNF (Dandified YUM)
Package Manager TypeLegacy package manager used in older RHEL versionsModern package manager used in newer RHEL versions
PerformanceSlower compared to DNFFaster and more efficient
Dependency ResolutionBasic dependency resolverAdvanced dependency resolver
Backend and LibrariesUses now deprecated YUM librariesUses hawkey library for dependency resolution
Command SyntaxFamiliar YUM commandsMaintains backward compatibility with YUM commands
Output and User ExperiencePlain text outputColorized text and progress bars
Plugin ArchitectureLimited extensibilityMore extensible with a robust plugin architecture
Package Downgrade SupportDoes not support package downgradesSupports package downgrades
Package Management APILimited APIWell-defined and documented API
Package CachingYesYes
Security and GPG KeyUses GPG signatures for package verificationUses GPG signatures for package verification
Default in Modern DistributionsNo, replaced by DNF in newer Fedora and RHEL versionsYes, default package manager
Package Group SupportBasic support for package groupsEnhanced support for package groups
difference-beetween-yum-and-dnf

If you are using other Linux distributions, such as Debian/Ubuntu (which use APT as their package manager) or Arch Linux (which uses Pacman), yum will not be available, and you should use the appropriate package manager for your distribution.

Leave a Comment