rhel 8 beta - Mount ISO as Repo

Latest response

I was tire kicking and did installation of RHEL 8 beta. But need a bunch more packages post installation that were not within the installation selection offering. So I figured I would just slurp the data off the ISO and mount it as repo...https://access.redhat.com/solutions/328863

but their is no media.repo

/dev/sr1 on /media/iso type iso9660 (ro,relatime,nojoliet,check=s,map=n,blocksize=2048)
[root@rhel8 iso]# ls
AppStream BaseOS EFI images isolinux TRANS.TBL
[root@rhel8 iso]# find . -name .repo
[root@rhel8 iso]# find . -name media.repo
[root@rhel8 iso]# ls -R |grep repo
....
[root@rhel8 iso]# cd BaseOS/
[root@rhel8 BaseOS]# ls
EULA GPL Packages repodata RPM-GPG-KEY-redhat-beta RPM-GPG-KEY-redhat-release TRANS.TBL
[root@rhel8 BaseOS]# cd repodata/
[root@rhel8 repodata]# ls
0ae7df487161471e2d27b3031ec5fb48c8ac0a1a853f27659ab51f5b39ff9edf-comps-BaseOS.x86_64.xml.gz 700c6e757cba9e584ff155a86182386fc810849755c796356469c9568af7a25c-productid.gz productid
42f75cdf0f98791c51d2ef4bdb1e2f465e8565aa328ada2c521ef67d8a9bf059-filelists.xml.gz 92f66cb405d6fdc5a23a2d6b0cf5acf7f0e3b30b6e2f43be5816e525cd178e8a-primary.xml.gz repomd.xml
5da7fce66ebea3f527120453e8ec60850c080e5e142a0df7ab256792408186c5-comps-BaseOS.x86_64.xml f76a7b47add70d5ad352398840455b185d7a833dc2b938c98b503bf33b6a3ac8-other.xml.gz TRANS.TBL
[root@rhel8 repodata]#

Not sure how to do this with rhel8.. or just newbie error on process I am missing.

Responses

EDITED 2020.03.04 - I DELETED MY ORIGINAL POST HERE The original person posting this question "Arrow SIVAC" incorrectly gave me credit for this when in fact Jerry Yu's solution below works for RHEL 8. Credit can not be changed by community leaders, only by the person who did the original post.

UPDATED 2 the links below in my updated post here do in fact go to the official Red Hat solution for both RHEL 8 and 7. However, see Jerry Yu's solution as well -- SCROLL DOWN See the reply in this specific discussion by Jerry Yu (thanks Jerry)

I'm presenting two Red Hat solutions here in this updated post, one for RHEL 8 and 7. Again, see Jerry Yu's solution below.

Important, this next link is for RED HAT 8

See this link for the method for RHEL 8

THIS IS FOR RHEL 7 below
See this link for the method for RHEL 7

Regards,
RJ

How is this the "Best Response" when it doesn't work at all for RHEL 8 Beta?

And what's the point of creating the directory /mnt/notmounted ?

In general RJ uses this subdirectory notmounted to provide a hint that a mount has failed. If the mount works, this subdirectory is not visible.

The "Best Response" is give by the original poster, so one way or the other it worked for him/her or the result cannot be revoked.

Now the links work and the credit is shared between Jerry and RJ, so now the label is fine to me.

Mike, see the updated post I made above citing the proper solutions etc. Also, see the comment by ir.Jan Gerrit Kootstra regarding the reason for making a "notmounted" subdirectory under any actual additional mountpoint.

Anytime I have a mountpoint that is not consistently used such as "/mnt" or "/iso" or "/dvd" and so forth, I have long had the practice of making a subdirectory called "notmounted" because when you perform an ls /mnt and if it returns "notmounted" then the mount is not active. ALTERNATIVELY a person can run the command such as mountpoint /mnt and the resulting output will show if that directory is or is not currently a mountpoint.

I based this on RJ's response, but named it after RHEL 8 Beta and to make it work, added BaseOS/AppStream and imported the GPG key:

[root@rhel8beta yum.repos.d]# cat rhel8beta-media.repo [RHEL_8_Beta_BaseOS] name=manually mount the drive first-rhel8 beta BaseOS iso repository baseurl=file:///mnt/BaseOS enabled=1 gpgcheck=1

[RHEL_8_Beta_AppStream] name=manually mount the drive first-rhel8 beta AppStream iso repository baseurl=file:///mnt/AppStream enabled=1 gpgcheck=1

[root@rhel8beta yum.repos.d]# rpm --import /mnt/AppStream/RPM-GPG-KEY-redhat-beta [root@rhel8beta yum.repos.d]# yum repolist Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. manually mount the drive first-rhel8 beta AppSt 2.8 kB/s | 2.8 kB 00:01 manually mount the drive first-rhel8 beta BaseO 2.7 kB/s | 2.7 kB 00:01 repo id repo name status RHEL_8_Beta_AppStream manually mount the drive first-rhel8 beta AppStream 4,594 RHEL_8_Beta_BaseOS manually mount the drive first-rhel8 beta BaseOS is 1,686

Peter's post works, except the format, plus a minor minor error ( the location of the GPG key). repost Peter's work below using MarkDown, for better visual, plus a quick correction. The GPG key import apparently is important. otherwise 'yum -y install vim-enhanced' or alike would fail without a clear error.

rhel8beta:/etc/yum.repos.d# mount /dev/sr0 /mnt
rhel8beta:/etc/yum.repos.d# df -h -P /mnt
Filesystem      Size  Used Avail Use% Mounted on
/dev/sr0        6.5G  6.5G     0 100% /mnt
rhel8beta:/etc/yum.repos.d# cat rhel8beta-media.repo 
[RHEL_8_Beta_BaseOS]
name=dvdmedia
baseurl=file:///mnt/BaseOS
enabled=1
gpgcheck=1
[RHEL_8_Beta_AppStream]
name=dvdmedia
baseurl=file:///mnt/AppStream
enabled=1
gpgcheck=1
rhel8beta:/etc/yum.repos.d# rpm --import /mnt/RPM-GPG-KEY-redhat-beta
rhel8beta:/etc/yum.repos.d# yum repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:09:54 ago on Tue 07 May 2019 04:28:54 PM EDT.
repo id                                                        repo name                                          status
RHEL_8_Beta_AppStream                                          dvdmedia                                           4,594
RHEL_8_Beta_BaseOS                                             dvdmedia                                           1,686

Thanks this worked for me.

thank you, it was very very clear for mount ISO on RHEL as VM on VMware. Many thumbs Up for this!

Regards,

Haikal S.