0

I have Linux red-hat machine version 7.2

I am using local repositories on the server - starmachine in order to install by yum

 root@test:/etc/yum.repos.d # more redhat.repo
 #
 # Certificate-Based Repositories
 # Managed by (rhsm) subscription-manager
 #
 # *** This file is auto-generated.  Changes made here will be over-written. ***
 # *** Use "subscription-manager repo-override --help" if you wish to make  changes. ***
 #
 # If this file is empty and this system is subscribed consider
 # a "yum repolist" to refresh available repos
 #

 #


 root@test:/etc/yum.repos.d # more  prv.repo
 [localbase]
 name=Red Hat Enterprise Linux 
 baseurl=http://starmachine/mnt/SO/ver/search/yum
 enabled=1
 gpgcheck=0

 [updates]
 name=Red Hat Enterprise Linux 
 baseurl=http://starmachine/mnt/SO/yum/lin/x86_64/updates
 enabled=1
 gpgcheck=0

what the changes that I need to do ( in which files ) in order to install by yum from the internet and not from the local repositories and download rpm from red-hat site

is it possible?

 test:~ # subscription-manager repos --list
 This system has no repositories available through subscriptions.
2
  • What happened to the original repo definitions? By default, RHEL will ship with remote repos enabled. Mar 28, 2016 at 19:30
  • really I also cant understand this , maybe someone that put all rpm also remove partial rpms because disk capacity
    – yael
    Mar 28, 2016 at 19:53

1 Answer 1

1

You can use yum-config-manager to add an online repository provided you have the url to a online repository (specifically, the .repo file):

yum-config-manager --add-repo repository_url
yum-config-manager --enable repository

where repository_url is the url of the .repo file and repository is the unique repository id that can be found using the yum repolist all command.

I believe that as long as you have a RHEL subscription, you are guaranteed access to RHEL repositories that you can access via yum. According to page in the RHEL7 documentation,

When the system is registered with Red Hat Subscription Management to the certificate-based Content Delivery Network (CDN), the Red Hat Subscription Manager tools are used to manage repositories in the /etc/yum.repos.d/redhat.repo file.

So if you want to access RHEL repos, you will need to use those tools. You can find more information on them in the RHEL documentation online (Documentation for RHEL 7, System Administrator's Guide, section 5.2: MANAGING SOFTWARE REPOSITORIES). For RHEL 7, you should be able to do this:

subscription-manager repos --list
subscription-manager repos --enable repository

The first command shows what RHEL repositories your subscription affords you, and the latter enables one of them.

EDIT: Based on this output:

 test:~ # subscription-manager repos --list
 This system has no repositories available through subscriptions.

It appears that your system does not have an active subscription. If you want to obtain a RedHat subscription, you will need to register with RedHat and purchase one (link in the comments).

If you do not have access to these repositories and would prefer not to buy a RHEL subscription, you can always install a CentOS repository, as the two are built from the same source and therefore their packages should be compatible (use your own discretion here, though; RHEL repositories are preferable). You can determine which release of CentOS is compatible with your particular installation on the CentOS wiki page (downloads section, towards the bottom; yours should be CentOS 7 (1511)), then use the "tree" link to the right to access a collection of rpms.

You can find more information on CentOS repositories on the CentOS wiki page under Additional Resources -> Repositories.

3
  • My apologies for not providing three of those links directly--I lack the reputation to include more than 2 links in a response. I will edit this answer (should those links be desired) once I have more reputation.
    – Tomboyo
    Mar 28, 2016 at 22:57
  • hi Tomboyo - see my update for un clear reason I get This system has no repositories available through subscriptions. ? do you know how to resolv this?
    – yael
    Mar 29, 2016 at 3:09
  • Hi yael, if you want to add RHEL repositories to your system, you will have to register through RedHat and purchase a subscription (which you can read about here)
    – Tomboyo
    Apr 1, 2016 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .