Linux 学习(一):RHEL 7 “There are no enabled repos” 的解决方法
原文链接:RHEL 7 - Solution to "There are no enabled repos" message原文:
(以下内容为原文机器翻译)
系统将出现以下提示信息:
Loaded plugins: 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
一种方法,最明显的方法是使用subscription-manager并遵循说明来注册您的RHEL7系统,从而启用RHEL的回购。为此,您需要付费或试用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 /etc//RHEL_7_Disc.repo [root@rhel7 ~]# cat /etc//RHEL_7_Disc.repo [RHEL_7_Disc] name=RHEL_7_x86_64_Disc baseurl="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 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(注:此处可能出现问题,解决方案见下文补充内容。)
现在,您将能够在未注册的RHEL 7 Linux机器上安装新软件。缺点是您不会收到任何新的更新,这可能会为您的系统创建一个安全问题。而且,使用yum命令时:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
补充:
运行yum repolist 有可能还是显示0。
RHEL_7_Disc.repo,若不存在此配置文件,手动创建并添加到 目录/etc/即可。
# cat /etc//RHEL_7_Disc.repo [RHEL_7_Disc] name=RHEL_7_x86_64_Disc baseurl="file:///media/rhel7-repo-iso/" gpgcheck=0