14

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
ManoDestra
  • 6,325
  • 6
  • 26
  • 50
Prakash Raman
  • 13,319
  • 27
  • 82
  • 132

6 Answers6

12

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!!!

erTugRul
  • 340
  • 6
  • 18
11

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.

ManoDestra
  • 6,325
  • 6
  • 26
  • 50
PentheusLennuye
  • 319
  • 2
  • 7
  • this is exactly why i prefer centos to redhat... subscriptions are just one more thing to look after that were a hassle in RHEL 6 series with the classic/etc changes. ugh. – joefromct Jun 23 '16 at 14:29
1

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"

Andy Thompson
  • 284
  • 1
  • 3
  • 21
1

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..

tplive
  • 687
  • 8
  • 17
0

If you have OS image in your lab or any location you can try this for some RPMS

vim /etc/yum.repos.d/rhel.repo
[rhel]
name=rhel
baseurl=http://172.25.5.25/osimages/rhel7.2_64bit
enabled=1
gpgcheck=0

Then do yum clean all

baseurl is the location where your OS image is available. No subscription is needed, it is reusing your OS image

Vijay S B
  • 1,251
  • 1
  • 13
  • 24
0

Try installing using:

yum install nmap-frontend

It worked for me on Red Hat Enterprise Linux Server release 7.7 (Maipo)

You can use the following line to test:

nmap 25 gmail-smtp-in.l.google.com