Tag Archives: rhel

Solutions to RHEL 7 “there are no enabled repos”

Solutions to RHEL 7 “there are no enabled repos”

[ 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, is your Yum warehouse problem, I now teach you to build a local Yum warehouse, so you can use it again!!

One of the most obvious ways is to use subscription manager and follow the instructions to register your rhel7 system to enable RHEL buy back. To do this, you need to pay or try a RedHat subscription. However, if you just want to play games and install software without the latest red hat subscription, you can install the downloaded red hat ISO image as the default local repository and install software. To enable your local repository, and thus overcome the second there are no enabled repos

[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/RHEL 7-repo-iso/create a new Yum repo file, which contains the following contents:

[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 it:

# 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

(Note: there may be problems here. See the following supplement for solutions.)

You will now be able to install new software on unregistered RHEL 7 Linux machines. The disadvantage is that you don’t receive any new updates, which may create a security issue 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:

Running Yum repolist may still display 0.

Yum puts the information about each warehouse in a separate file (in the directory/etc)/ yum.repos . d), when “there are no enabled repos” and “Yum repolistall” are still displayed as 0, then look at the directory/etc/ yum.repos Does the previously created configuration file exist under. D

RHEL_7_Disc.repo

If this configuration file does not exist, manually create and add it to the directory/etc/ yum.repos . D.

# cat /etc/yum.repos.d/RHEL_7_Disc.repo     Create this new file repo, then save it, and you can install other services again!
[rhel7]
name=rhel7
baseurl=file:///media/cdrom/
enabled=1
gpgcheck=0

Finally do a mount it, boot automatically start, convenient 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 defaults 0 0
/dev/CDROM/Andy iso9660 defaults 0 0// with this sentence, it’s good
~
~ finally.

The problem of “no packages” in centos7

“No packages in any requested group available to install or update” in centos7

Using Yum to install X-Windows today, the following error was reported:

sudo  yum groups install "X Window System"

Loading mirror speeds from cached hostfile
 * base: mirrors.shu.edu.cn
 * epel: mirror.dmmlabs.jp
 * extras: mirrors.cn99.com
 * updates: mirrors.cn99.com
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

It can’t be installed. It’s invalid. The command is correct. Go to the official website to find out the reason. You can see why Yum groupinstall “package group name” is failing on RHEL 7 with error “there is no installed groups file” on the official website, which exactly describes this problem.

It turns out that after 7, the default options are not installed, so you need to add the default items yourself. The solution is: Yum groupinstall "office suite and productivity" -- setopt = group_ package_ types=mandatory,default,optional

Add — setopt = group after_ package_ Types = mandatory, default, optional

sudo  yum groupinstall "X Window System"  --setopt=group_package_types=mandatory,default,optional