Brief-Wishbone9091
Member
Does it mean I can download softwares without using internet once the local yum repository is set up?
Please explain what does it mean? And how to setup in centos 7?
Here's an article but it confused. I've how to do this in RHEL9. But not sure what'd be equivalent command for centos 7.
Please explain what does it mean? And how to setup in centos 7?
How to Setup Local Yum Repository on CentOS 7 {Easy Tutorial}
In this SIMPLE Updated Tutorial Learn how to setup a local YUM repository on CentOS 7. Discover the easy way to get started using custom repositories!
phoenixnap.com
Code:
[HEADING=3]Explanation[/HEADING]
1. To mount the “RHEL-9.iso” file to the mount point “/opt” as a loop device, allowing you to access the contents of the ISO file as if it were a physical CD or DVD, run:
# mount -o loop RHEL-9.iso /opt
Note that
· The "-o loop" option specifies that the ISO file should be mounted as a loop device.
[LIST]
[*]A loop device is a pseudo-device that makes the ISO file accessible as a block device.
[*]You should have a RHEL-9.iso file available on your system to mount it to "/opt".
[/LIST]
To keep the mount persistent, append the mount line to the file "/etc/fstab", with the following command:
# echo "path/to/RHEL-9.iso /opt iso9660 loop 0 0" >> /etc/fstab
To mount all file systems specified in the "/etc/fstab" file, run:
# mount -a
2. To copy the file “/opt/media.repo“ to “/etc/yum.repos.d/rhel9.repo”, run:
# cp /opt/media.repo /etc/yum.repos.d/rhel9.repo
3. To set the file “rhel9.repo” permissions to allow the owner to read and write the file, users in the same group as the owner to read the file, and all other users to read the file, run:
# chmod 644 /etc/yum.repos.d/rhel9.repo
4. To edit the “rhel9.repo” file, run:
# vim etc/yum.repos.d/rhel9.repo
5. Replace the data in the file with this data:
[InstallMedia-BaseOS]
name=RHEL 9 - BaseOS
metadata_expire=-1
gpgcheck=0
enabled=1
baseurl=file:///opt/BaseOS/
[InstallMedia-AppStream]
name=RHEL 9 - AppStream
metadata_expire=-1
gpgcheck=0
enabled=1
baseurl=file:///opt/AppStream/
6. Press Esc to switch to command, then type ":wq" followed by Enter to save and quit.
7. To clean yum/dnf and the subscription-manager cache, use:
# dnf clean all
# subscription-manager clean
Note that
[LIST]
[*]You may receive a "This system is not registered" warning message. To prevent this warning message, edit the file "/etc/yum/pluginconf.d/subscription-manager.conf" and change the value of the "enabled" parameter from "1" to "0".
[/LIST]
8. To list available repositories for the system, use:
# dnf repolist