How to Install Specific Version of Package use YUM

In this tutorial, I will use YUM command to install specific version of Package.


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 ~]#  

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

How to install php7 on centos 6