Thursday 5 July 2018

How to install perl-Switch package in RHEL7



perl-Switch package is not available in RHEL7 default repository  “rhel-7-server-rpms/7Server/x86_64”. Install the perl-Switch package by enabling RHEL Optional repository
“rhel-7-server-optional-rpms”.

Step 1: Follow the below command to check default enabled repositories:

[root@linuxcnf ~]# yum repolist
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
repo id                                     repo name                     status
rhel-7-server-rpms/7Server/x86_64  Red Hat Enterprise Linux 7 Server (RPMs)                                                20,672
repolist: 33,276
[root@linuxcnf ~]#

In the above output the RHEL optional repository is not enabled.

Step 2: Follow the below command to install perl-Switch package by enabling RHEL optional repository:

[root@linuxcnf ~]# yum install perl-Switch --enablerepo=rhel-7-server-optional-rpms
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
rhel-7-server-optional-rpms                                               | 3.5 kB  00:00:00
(1/3): rhel-7-server-optional-rpms/7Server/x86_64/group           |  30 kB  00:00:02
(2/3): rhel-7-server-optional-rpms/7Server/x86_64/updateinfo     | 2.1 MB  00:00:03
(3/3): rhel-7-server-optional-rpms/7Server/x86_64/primary_db    | 7.2 MB  00:00:05
Resolving Dependencies
…….
Installed:
  perl-Switch.noarch 0:2.16-7.el7

Complete!
[root@linuxcnf ~]#

Step 3: Verify the installation following the below command:

[root@linuxcnf ~]# yum list perl-Switch
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Installed Packages
perl-Switch.noarch                  2.16-7.el7                   @rhel-7-server-optional-rpms
[root@linuxcnf ~]#

Package installation done!!!

2 comments:

  1. Thankyou.
    FYI for my RHEL 7.5 from AWS the command is:
    yum install perl-Switch --enablerepo=rhui-REGION-rhel-server-optional

    ReplyDelete
  2. When I run the cmd "yum install perl-Switch --enablerepo=rhel-7-server-optional-rpms" We are getting the below error

    Loaded plugins: enabled_repos_upload, langpacks, package_upload, product-id, rhnplugin, search-disabled-repos, subscription-manager
    This system is not registered with RHN Classic or Red Hat Satellite.
    You can use rhn_register to register.
    Red Hat Satellite or RHN Classic support will be disabled.
    rhel-7-server-optional-rpms | 1.8 kB 00:00:00
    rhel-7-server-rpms | 2.0 kB 00:00:00
    No package perl-Switch available.
    Error: Nothing to do
    Uploading Enabled Repositories Report

    ReplyDelete