Unable to yum install anything on RHEL

54,731

Solution 1

Red Hat doesn't use the /etc/yum.repos.d directory for official packages so the answer won't be in there. It will use the subscription plugin placed in /etc/yum/pluginconf.d.

You mentioned that the RHEL host is new. You will need to make sure your subscription is valid or yum will fail silently.

You can use the subscription-manager list command to gain info regarding subscriptions.

Solution 2

Centos has done it for you.

Create a repo file in /etc/yum.repos.d as

vi /etc/yum.repos.d/myrepo.repo

Then paste this in this file:

[centos]
name=CentOS-7
baseurl=http://ftp.heanet.ie/pub/centos/7/os/x86_64/
enabled=1
gpgcheck=1
gpgkey=http://ftp.heanet.ie/pub/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7

Saving it with wq! now run

yum repolist

Check if you can install any package (say nmap)

yum install nmap -y

Enjoy!!!

Solution 3

Try "searching" for the correct package name in the reps by using yum list

yum list nmap

I guess the correct package name and install command is:

yum install nmap.x86_64

You can also do a "yum search somename"

Solution 4

In my case, I was trying to install OpenJDK using yum; sudo yum install -y java-1.8.0-openjdk-devel but received an error message stating that a dependency was unavailable:

---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.201.b09-1.el6_10 will be installed
--> Processing Dependency: pcsc-lite-devel(x86-64) for package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.8.0-openjdk-headless-1.8.0.201.b09-1.el6_10.x86_64 (rhel-6-server-rpms)
           Requires: pcsc-lite-devel(x86-64)
**********************************************************************
yum can be configured to try to resolve such errors by temporarily enabling
disabled repos and searching for missing dependencies.
To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf
**********************************************************************

I resolved this by following the suggestion please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf and then ran the yum command again. This time yum loaded a bunch of [previously disabled] repos and searched through them, finally reporting success and this message:

*******************************************************************
Dependency resolving was successful thanks to enabling these repositories:
rhel-6-server-optional-rpms
*******************************************************************

So there was no ignored *-devel repo, but still doing this worked. For clearance, the explicitly ignored repos are: ignored_repos=*debug-rpms *source-rpms *beta-rpms

..so that worked, but I'm still no wiser on the mechanics of this..

Share:
54,731
Moodie
Author by

Moodie

Updated on July 09, 2022

Comments

  • Moodie
    Moodie almost 2 years

    I am on a new RHEL system.

    I seem to be unable to be able to install anything package via yum install.

    yum install nmap
    

    The current repos in

    ls /etc/yum.repos.d/
    google-chrome.repo  redhat.repo         rhel-source.repo
    

    What could be going wrong ?

    OUTPUT OF YUM INSTALL:

    $ sudo yum install nmap
    [sudo] password for user: 
    Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
    Updating certificate-based repositories.
    Setting up Install Process
    No package nmap available.
    Error: Nothing to do