Hello @kylemuncie !
Thanks for reaching out !
Due to the NDA - discussions about exam scenarios is out of bound for us.
However, generally speaking - To create a local repo in RHEL 9, you have to do the following steps in a nutshell :
a. Mount the RHEL 9 ISO file ( download it from here : https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.0/x86_64/product-software ) to a directory
#mkdir -p /mnt/disc
# mount -o loop rhel-baseos-9.0-x86_64-dvd.iso /mnt/disc
b. You need to create a local repository file in “/etc/yum.repos.d” directory. This file will define the location of your local repository. Create a file with a name but with a .repo extension , eg. rhel9.repo with the correct file paths as per your system. The content of /etc/yum.repos.d/rhel9.repo will look something like this
# vi /etc/yum.repos.d/rhel9.repo [BaseOS] name=BaseOS Packages Red Hat Enterprise Linux 9 metadata_expire=-1 gpgcheck=1 enabled=1 baseurl=file:///mnt/disc/BaseOS/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release [AppStream] name=AppStream Packages Red Hat Enterprise Linux 9 metadata_expire=-1 gpgcheck=1 enabled=1 baseurl=file:///mnt/disc/AppStream/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
c. Update the package index : #dnf clean all
#dnf repolist
d. Done ! If everything is ok and without any issues , you can start installing packages with
#dnf install <package-name>
#dnf check-update
Hello @kylemuncie !
Thanks for reaching out !
Due to the NDA - discussions about exam scenarios is out of bound for us.
However, generally speaking - To create a local repo in RHEL 9, you have to do the following steps in a nutshell :
a. Mount the RHEL 9 ISO file ( download it from here : https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.0/x86_64/product-software ) to a directory
#mkdir -p /mnt/disc
# mount -o loop rhel-baseos-9.0-x86_64-dvd.iso /mnt/disc
b. You need to create a local repository file in “/etc/yum.repos.d” directory. This file will define the location of your local repository. Create a file with a name but with a .repo extension , eg. rhel9.repo with the correct file paths as per your system. The content of /etc/yum.repos.d/rhel9.repo will look something like this
# vi /etc/yum.repos.d/rhel9.repo [BaseOS] name=BaseOS Packages Red Hat Enterprise Linux 9 metadata_expire=-1 gpgcheck=1 enabled=1 baseurl=file:///mnt/disc/BaseOS/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release [AppStream] name=AppStream Packages Red Hat Enterprise Linux 9 metadata_expire=-1 gpgcheck=1 enabled=1 baseurl=file:///mnt/disc/AppStream/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
c. Update the package index : #dnf clean all
#dnf repolist
d. Done ! If everything is ok and without any issues , you can start installing packages with
#dnf install <package-name>
#dnf check-update
Chetan has provided another complete and easy to
follow explanation. I'll just add one something, that is
the equivalent of sprinkling a little salt on a gourmet
meal:
$ sudo yum list available
- this will simply list all of the packages in all repos
Thanks @Trevor for your addition.
and one can use grep to filter out packages available only in a specific repo eg. epel repo :
yum list available | grep epel
Hello @Chetan_Tiwary_ ,
I think my question is about part a now... I am currently booted in a VirtualBox instance of red hat 9.3. Inside of the vm, do i need to go into firefox and download that dvd.iso file or should it already be availiable?
I am trying these two commands and it is giving me a failure to setup loop device for it:
#mkdir -p /mnt/disc
# mount -o loop rhel-baseos-9.3-x86_64-dvd.iso /mnt/disc
I am using locate to see if I have the dvd.iso but it returns nothing:
# locate rhel-baseos-9.3-x86_64-dvd.iso
Thank you for the help!
Yes, you have to download the ISO through a browser and then you can proceed with the next steps.
As usual perfect explanation @Chetan_Tiwary_
Hey! Apologies for being late to the party.
Out of interest would you need to persistently mount the iso file, via fstab, for the repo to work after a reboot?
Thanks!
Question,
Correction, for a remote DVD repository, would you need to enter gpgkey? if so, would you still point to /etc/pki/rpm-gpg or would you point to http://x.x.x.x/dvd/RPM-GPG
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.