RHEL 7 Solution "There are no enabled repos" of

RHEL 7 Solution "There are no enabled repos" of

 

[root@system1 Desktop]# yum install squid
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There are no enabled repos.
Run "yum repolist all" to see the repos you have.
You can enable repos with yum-config-manager --enable <repo>

 

See the above error, yum repository is your problem, I now teach you to build a local YUM repository, so that you can re-use it! !

 

    One way, the most obvious way is to use the subscription-manager and follow the instructions to register your RHEL7 systems to enable the repurchase of RHEL. To do this, you need to pay a subscription or trial Redhat. However, if you just want to play the game without the need for the latest Red Hat subscription and install the software, you can install the downloaded ISO image of Red Hat, and as the default local repository, and the ability to install the software. To enable your local repository, and to overcome the first There are no enabled repos time to mount your REHL7 ISO image:

       

[root@rhel7 ~]# mkdir /media/rhel7-repo-iso
[root@rhel7 ~]# mount /dev/cdrom /media/rhel7-repo-iso/
mount: /dev/sr0 is write-protected, mounting read-only

        Now, when you install RHEL 7 iso, please / media / rhel7-repo-iso / create a new yum repo file that contains the following:

[root@rhel7 ~]# vi /etc/yum.repos.d/RHEL_7_Disc.repo
[root@rhel7 ~]# cat /etc/yum.repos.d/RHEL_7_Disc.repo
[RHEL_7_Disc]
name=RHEL_7_x86_64_Disc
baseurl="file:///media/rhel7-repo-iso/"
gpgcheck=0

        Once ready, check the new warehouse to enable this repository:

# yum repolist
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
RHEL_7_Disc                                                                                                                                      | 4.1 kB  00:00:00     
(1/2): RHEL_7_Disc/group_gz                                                                                                                      | 134 kB  00:00:00     
(2/2): RHEL_7_Disc/primary_db                                                                                                                    | 3.4 MB  00:00:00     
repo id                                                                      repo name                                                                            status
RHEL_7_Disc                                                                  RHEL_7_x86_64_Disc                                                                   4,305
repolist: 4,305

: (Possible problems here, solutions, see note below to add content.)

        To install new software on 7 Linux machine now, you will be able to unregistered RHEL. The disadvantage is that you will not receive any new updates, it may create a security problem for your system. Also, when using the yum command:

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

supplement:

        Run yum repolist there may still show 0.

        yum information about each warehouse into a separate file (in the directory /etc/yum.repos.d), when yum still display " There are NO Enabled Repos", "yum repolistall" is still displayed as 0, then look directory whether there is a configuration file created before the next /etc/yum.repos.d

RHEL_7_Disc.repo

, If there is this profile, manually created and added to the directory /etc/yum.repos.d can be.

# Cat /etc/yum.repos.d/RHEL_7_Disc.repo      New this file repo, then save, you can install the other services it! 
[rhel7] 
name = rhel7 
BaseURL = File: /// Media / CDROM / 
Enabled. 1 = 
gpgcheck = 0

Finally, do a mount of it, at startup for later use

 

[root@system1 ~]# vim /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Jul 16 15:51:34 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rhel-root / xfs defaults 1 1
UUID=9cead03a-2b93-4686-9b23-70cfb9264f3f /boot xfs defaults 1 2
/dev/mapper/rhel-swap swap swap defaults 0 0
/dev/cdrom /andy iso9660 defaults 0 0                            // 加上这一句话,就好了
~
~最后完成。

Guess you like

Origin www.cnblogs.com/linuxandy/p/11334586.html