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:
[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:
-
First, open the Terminal on your system.
-
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.
-
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.
-
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
EXPLANATIONAfter 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.
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”.
-
Afterward, press “Y” to confirm the installation as shown in the above image.
-
Next, the system will automatically download and install your app package along with all of its dependencies, as illustrated in the image below:
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
- How to Show List of Installed Packages Using YUM [2 Cases]
- How to List Installed Packages Using RPM [2 Practical Cases]
- 3 Ways to Install Pacman Package Manager in Ubuntu
- How to Install Local Package Using RPM [A Quick Guide]
- How to Install RPM Packages Using DNF [4 Useful Cases]
- How to Install Local Package Using DNF [2 Practical Cases]
- 2 Ways to Install Group Packages Using DNF [With Cases]
- 5 Ways to List Installed Packages in RHEL Using DNF With Cases
- How to Install RPM Packages From Text File [5 Simple Cases]
<< Go Back to Package Installation in Linux | Package Management in Linux | Learn Linux Basics
FUNDAMENTALS A Complete Guide for Beginners