How to install optional rpms on RedHat 7?

jhon.smith picture jhon.smith · Dec 13, 2017 · Viewed 8.8k times · Source

I am trying to install RedHat optional rpms on RHEL 7 as follow.

sudo yum install rhel-7-server-extras-rpms rhel-7-server-optional-rpms
Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos, subscription-
              : manager
This system is receiving updates from RHN Classic or Red Hat Satellite.
epel/x86_64/metalink                                                |  13 kB  00:00:00
epel                                                                | 4.7 kB  00:00:00
nginx                                                               | 2.9 kB  00:00:00
nodesource                                                          | 2.5 kB  00:00:00
(1/5): epel/x86_64/group_gz                                         | 266 kB  00:00:00
(2/5): epel/x86_64/updateinfo                                       | 860 kB  00:00:00
(3/5): nginx/x86_64/primary_db                                      |  31 kB  00:00:00
(4/5): nodesource/x86_64/primary_db                                 |  29 kB  00:00:00
(5/5): epel/x86_64/primary_db                                       | 6.1 MB  00:00:02
rhel-x86_64-server-7                                                | 1.5 kB  00:00:00
rhel-x86_64-server-7/group                                          | 636 kB  00:00:00
rhel-x86_64-server-7/updateinfo                                     | 2.1 MB  00:00:00
rhel-x86_64-server-7/primary                                        |  25 MB  00:00:02
rhel-x86_64-server-7                                                           17802/17802
No package rhel-7-server-extras-rpms available.
No package rhel-7-server-optional-rpms available.
Error: Nothing to do

I am not able to understand this .

Why are the optional rpms not available to me ?

How do i setup a local repository of optional and extra rpms ?

Answer

evantkh picture evantkh · Dec 16, 2017

RHEL is not CentOS. The configurations to access repositories are not provided as an RPM. You should use the following commands to turn on the repositories instead of installing them from existing repositories.

subscription-manager repos --enable rhel-7-server-optional-rpms
subscription-manager repos --enable rhel-7-server-extras-rpms

After that, check the enabled repositories using

yum repolist