How to set up local media for CentOS 8 installation sources?
To set up a local installation source on CentOS 8, you need to complete the following steps:
- Copy the CentOS 8 installation media (ISO file or DVD) to a local directory, such as /media/CentOS8.
- Open the terminal and log in as the root user or a user with sudo privileges.
- Open the /etc/yum.repos.d/ directory and check for files with the extension .repo, as these are the configuration files for yum installation sources.
- It is recommended to first backup any files with the extension .repo to another directory to prevent any issues from occurring.
- Create a new centos8.repo file and make modifications to it.
- Open the centos8.repo file in the /etc/yum.repos.d/ directory using the command sudo vi.
- Type the following content in the editor:
- [Local CentOS8]
name=Local CentOS 8 Repository
baseurl=file:///media/CentOS8
enabled=1
gpgcheck=0 - Replace “/media/CentOS8” here with the actual directory path where you have stored the CentOS 8 installation media.
- Setting the option “enabled” to 1 enables the installation source, while setting the option “gpgcheck” to 0 indicates that GPG checks will not be performed.
- Save the file and exit the editor.
- Update the yum cache:
- Please clear all the cached packages using “sudo dnf clean all” and then update the metadata cache using “sudo dnf makecache”.
- Now you can use local media as the installation source for installing and upgrading software packages on CentOS 8.
Please note that using local media as an installation source may result in some software packages not being updated in a timely manner, as they may not be present in the local media. If you require the latest software packages, consider using the official remote installation sources.