How to enable repo in RHEL 7
How to enable repo in RHEL 7
1. Check the OS release.
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.1 (Maipo)
2. Attach the ISO to VM (Not Recommended) or Copy the Contents (Recommended).Red Hat Enterprise Linux Server release 7.1 (Maipo)
3. Mount ISO to a directory or Mount attached (cdrom) ISO to a dirctory.
mount -o loop <Path to ISO> <mount Path>
OR
mount /dev/cdrom /mnt
4. Create a repo file and put in this content.OR
mount /dev/cdrom /mnt
[root@localhost ~]# cat /etc/yum.repos.d/redhat_DISC.repo
[RHEL_7_Disc]
name=RHEL_7_x86_64_Disc
baseurl="file:///mnt/"
gpgcheck=0
[root@localhost ~]# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/sr0 3.7G 3.7G 0 100% /mnt
[root@localhost ~]#
[RHEL_7_Disc]
name=RHEL_7_x86_64_Disc
baseurl="file:///mnt/"
gpgcheck=0
[root@localhost ~]# df -h /mnt
Filesystem Size Used Avail Use% Mounted on
/dev/sr0 3.7G 3.7G 0 100% /mnt
[root@localhost ~]#
5. Now enter Following Commands.
yum clean all
[root@localhost ~]# 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
epel/x86_64/metalink | 6.7 kB 00:00:00
epel | 4.3 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 628 kB 00:00:03
(2/2): epel/x86_64/primary_db | 4.2 MB 00:05:21
repo id repo name status
RHEL_7_Disc RHEL_7_x86_64_Disc 4,371
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10,631
repolist: 15,002
[root@localhost ~]#
[root@localhost ~]# 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
epel/x86_64/metalink | 6.7 kB 00:00:00
epel | 4.3 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 628 kB 00:00:03
(2/2): epel/x86_64/primary_db | 4.2 MB 00:05:21
repo id repo name status
RHEL_7_Disc RHEL_7_x86_64_Disc 4,371
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 10,631
repolist: 15,002
[root@localhost ~]#
6. Now you are all set to install software through yum.
No comments