RHEL7“Therearenoenabledrepos”的解决⽅法
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 u subscription-manager to register.
There are no enabled repos.
Run "yum repolist all" to e the repos you have.
You can enable repos with yum-config-manager --enable <repo>
儿童辫子100种编法看到以上的报错,是你的 yum仓库出问题了,我现在教⼤家建⼀个本地YUM仓库,这样就可以再使⽤啦!!
⼀种⽅法,最明显的⽅法是使⽤subscription-manager并遵循说明来注册您的RHEL7系统,从⽽启⽤RH
EL的回购。为此,您需要付费或试⽤Redhat订阅。但是,如果您只是想在不需要最新红帽订阅的情况下进⾏游戏并安装软件,则可以安装下载的红帽ISO映像,并将其作为默认的本地存储库,并能够安装软件。要启⽤您的本地存储库,并从⽽克服第There are no enabled repos.⼀次挂载您的REHL7 ISO映像:[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
现在,当您安装RHEL 7 iso时,请/media/rhel7-repo-iso/创建⼀个新的yum repo⽂件,其中包含以下内容:
[root@rhel7 ~]# vi /pos.d/RHEL_po
[root@rhel7 ~]# cat /pos.d/RHEL_po
[RHEL_7_Disc]
name=RHEL_7_x86_64_Disc
baurl="file:///media/rhel7-repo-iso/"
gpgcheck=0
⼀旦准备就绪,检查新的仓库以启⽤这个仓库:
# yum repolist
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can u 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
(注:此处可能出现问题,解决⽅案见下⽂补充内容。)
现在,您将能够在未注册的RHEL 7 Linux机器上安装新软件。缺点是您不会收到任何新的更新,这可能会为您的系统创建⼀个安全问题。⽽且,使⽤yum命令时:
This system is not registered to Red Hat Subscription Management. You can u subscription-manager to register.
补充:
运⾏yum repolist 有可能还是显⽰0。
yum将有关各个仓库的信息放到了单独⽂件中(在⽬录/pos.d下),当yum仍然显⽰“There are no enabled repos” , “yum repolistall“仍显⽰为0,那就看⽬录/pos.d下是否存在之前创建的配置⽂件
RHEL_po
,若不存在此配置⽂件,⼿动创建并添加到⽬录/pos.d即可。
# cat /pos.d/RHEL_po 新建这个⽂件repo,再保存,你就可以再安装了其他服务啦!
补阳的中药[rhel7]
name=rhel7
baurl=file:///media/cdrom/
enabled=1
gpgcheck=0
最后再做⼀个挂载吧,开机⾃动启动,⽅便以后使⽤
[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 // 加上这⼀句话,就好了~
~最后完成。