How to Install Specific Version of Package use YUM

Introduction

Learn how to install specific versions of packages using YUM on CentOS/RHEL systems with detailed steps and advanced examples.

YUM (Yellowdog Updater, Modified) is a powerful package management tool used in CentOS and RHEL-based systems. While installing the latest version of a package is straightforward, sometimes you might need a specific version. This guide covers the steps to install a specific package version using YUM, from basic to advanced examples.

Understanding YUM and RPM

YUM is a front-end tool for RPM (Red Hat Package Manager) that manages package installations, updates, and removals. RPM is the underlying package format used by Red Hat-based distributions. Understanding these tools is crucial for efficient package management.

What is YUM?

YUM simplifies the process of managing RPM packages by resolving dependencies and retrieving package metadata from repositories. It can install, update, and remove packages from your system.

What is RPM?

RPM is a low-level tool that installs, verifies, and manages packages in Red Hat-based systems. YUM uses RPM packages and handles their dependencies.

Basic Steps to Install a Specific Version

To install a specific version of a package, follow these steps:

Step 1: How to list the available package version in our repository.

Syntax:
# yum --showduplicate list [package_name]
For Example
[root@devopsroles ~]# yum --showduplicate list nodejs
Remi's Modular repository for Enterprise Linux 8 - x86_64                                                                                                                          207 kB/s | 539 kB     00:02
Safe Remi's RPM repository for Enterprise Linux 8 - x86_64                                                                                                                         388 kB/s | 1.4 MB     00:03
Available Packages
nodejs.x86_64                                                                           1:10.19.0-1.module_el8.1.0+277+2bccb1a9                                                                           AppStream

Step 2: Install the specific version of the nodejs package

Syntax:

# yum install [package-name]-[version].[architecture]
For Example
[root@devopsroles ~]# yum install nodejs-1:10.19.0-1.module_el8.1.0+277+2bccb1a9.x86_64
Last metadata expiration check: 0:01:47 ago on Mon 30 Mar 2020 02:15:13 PM UTC.
Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                Architecture                           Version                                                                             Repository                                 Size
===================================================================================================================================================================================================================
Installing:
 nodejs                                 x86_64                                 1:10.19.0-1.module_el8.1.0+277+2bccb1a9                                             AppStream                                 9.0 M
Installing dependencies:
 npm                                    x86_64                                 1:6.13.4-1.10.19.0.1.module_el8.1.0+277+2bccb1a9                                    AppStream                                 3.8 M
Enabling module streams:
 nodejs                                                                        10

Transaction Summary
===================================================================================================================================================================================================================
Install  2 Packages

Total download size: 13 M
Installed size: 63 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): npm-6.13.4-1.10.19.0.1.module_el8.1.0+277+2bccb1a9.x86_64.rpm                                                                                                               1.7 MB/s | 3.8 MB     00:02
(2/2): nodejs-10.19.0-1.module_el8.1.0+277+2bccb1a9.x86_64.rpm                                                                                                                     3.2 MB/s | 9.0 MB     00:02
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              3.9 MB/s |  13 MB     00:03
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Running scriptlet: npm-1:6.13.4-1.10.19.0.1.module_el8.1.0+277+2bccb1a9.x86_64                                                                                                                               1/1
  Preparing        :                                                                                                                                                                                           1/1
  Installing       : npm-1:6.13.4-1.10.19.0.1.module_el8.1.0+277+2bccb1a9.x86_64                                                                                                                               1/2
  Installing       : nodejs-1:10.19.0-1.module_el8.1.0+277+2bccb1a9.x86_64                                                                                                                                     2/2
  Running scriptlet: nodejs-1:10.19.0-1.module_el8.1.0+277+2bccb1a9.x86_64                                                                                                                                     2/2
  Verifying        : nodejs-1:10.19.0-1.module_el8.1.0+277+2bccb1a9.x86_64                                                                                                                                     1/2
  Verifying        : npm-1:6.13.4-1.10.19.0.1.module_el8.1.0+277+2bccb1a9.x86_64                                                                                                                               2/2

Installed:
  nodejs-1:10.19.0-1.module_el8.1.0+277+2bccb1a9.x86_64                                                 npm-1:6.13.4-1.10.19.0.1.module_el8.1.0+277+2bccb1a9.x86_64

Complete!
[root@devopsroles ~]#  

Conclusion

Installing a specific version of a package using YUM can be crucial for compatibility and stability in various environments. Whether you are managing servers or developing applications, knowing how to control package versions is essential. Follow these steps and techniques to effectively manage your system’s packages. Thank you for reading the huuphan.com page!

Hands-on youtube



Comments

Popular posts from this blog

zimbra some services are not running [Solve problem]

Bash script list all IP addresses connected to Server with Country Information

Zimbra Client host rejected Access denied fixed