How to Install Specific Version of a Package Using YUM

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

YUM (Yellowdog Updater Modified) holds its ground as a pivotal package manager in Red Hat-based distributions like RHEL, Fedora, CentOS, etc. It is built on top of the rpm package manager, providing an array of features that surpass the fundamentals of rpm. It simplifies package installation, handles dependencies, manages versions, and facilitates uninstallation, enhancing the user experience in Linux/Unix systems. In this guide, I will delve into how using the yum package manager you can install a specific version of an app package in Red Hat-based distributions.

Process flow chart to install a specific version of a package using YUM:

step by step process of how to use the yum package manager to install a specific version of an app package in Red Hat-based distributions using the command line interface (CLI)

[Distro Used Throughout the Tutorial: RHEL 9.2]

Steps to Install Specific Version of a Package Using YUM

YUM package manager is best suited to use in Red Hat-based Linux systems. Package installation is a vital part of package management. Sometimes you need to install a specific version of a package in your system. You can easily handle that task using the yum package manager in the Command Line Interface (CLI). The general syntax to install a specific version of an app package using yum is: sudo yum install <package_name>-<version> .

If you want to install a specific version of an app package in your Red Hat-based system using the yum package manager you can follow the below processes:

  1. First, open the Terminal on your system.

  2. Next, type the following command to check all available versions of the app package in the remote repositories:

    yum --showduplicate list php
    EXPLANATION
    • yum: Package manager in Red Hat-based distributions.
    • showduplicate: Display duplicates (other versions) of the package in the output.
    • list: This option can show all available and installed packages in your system.
    • php: Name of the app package I want to install.

    search for all available versions of the app packages in the remote repositories

  3. After that, hit ENTER. The terminal will display all available versions of the app package from the remote repositories. It will look similar to the above image.

  4. Now, if you want to install a specific version from the list from the remote repositories then run the following command:

    sudo yum install php-8.0.20-3.el9.x86_64
    EXPLANATION
    • sudo: Permits administrative permission.
    • install: Install an app package from the remote repository using Yum.
    • php-8.0.20-3.el9.x86_64: Specific version of the app I want to install.

    After executing this, the system will prompt you to enter your sudo user password, as shown in the following image. Provide your sudo password. Subsequently, the system will display your specified version of the app package, along with all the necessary dependencies.

    install specific version of the app package from the remote repositories using yum

    NOTE: If you do not find the specific version you are looking for in the remote repositories but you have access to the app package’s rpm file for that version then you can follow the process described in this guide “How to Install Local Package Using YUM”.

    press Y to confirm automatic download and installation

  5. Afterward, press “Y” to confirm the installation as shown in the above image.

  6. Next, the system will automatically download and install your app package along with all of its dependencies, as illustrated in the image below:

    specific version of app package installation complete

    Finally, You will complete the installation of the specific version of the particular app package on your system.

Conclusion

In this article, I have discussed the simplest way to install a specific version of an app package by using the yum package manager in a Red Hat-based system. I hope this article has been helpful and you were able to install the specific version of a package in your Linux system.

People Also Ask

How to install specific version via yum?

To install a specific version of a package using yum on a centOS or Red Hat-based system, you use the sudo yum install <package-name>-<version>. Just replace <package-name> with the actual name of the package and <version> with the specific version number you want to install.

How to install specific version using DNF?

To install a specific version of an app package using dnf, run this command sudo dnf install <package_name>-<version> in the terminal. Dnf is the most updated and efficient package manager in the Red Hat-based Linux or Unix system.

How do you upgrade a specific package using yum?

To upgrade a specific app package using yum, execute sudo yum update <package_name> command in the terminal. In Red Hat-based distributions yum is a very dependable package manager.

How to install yum command in Linux?

To install yum in Debian-based Linux distros run sudo apt install yum in your terminal. Moreover, if you want to install YUM in an Arch Linux-based distribution, execute the following command sudo pacman -S yum in the terminal.

How do I install a specific version of a program in Linux?

The command for installing a specific package version varies with the Linux distribution and package manager. The sudo apt install <package_name>=<version> is used in Debian-based Linux, sudo dnf install <package_name>-<version> is used in Red Hat-based distribution, and for Arch Linux sudo pacman -S <package_name>=<version> is used to install a specific version of an app package.

Related Articles


<< Go Back to Package Installation in Linux | Package Management in Linux | Learn Linux Basics

4.8/5 - (16 votes)
Ridoy Chandra Shil

Hello everyone. I am Ridoy Chandra Shil, currently working as a Linux Content Developer Executive at SOFTEKO. I am a Biomedical Engineering graduate from Bangladesh University of Engineering and Technology. I am a science and tech enthusiast. In my free time, I read articles about new tech and watch documentaries on science-related topics. I am also a big fan of “The Big Bang Theory”. Read Full Bio

Leave a Comment