How to set up a local yum repository for installing Linux?
To set up a local yum repository and install software packages, you can follow these steps:
- Download the RPM package of the software:
You can find the RPM package of the software you need to install on the official website or other reliable sources. Download the RPM package to a local directory. - Create a local yum repository:
Open a terminal and log in to the system as root user. Then, create a directory to serve as the storage location for the local yum repository. For example, create a directory named “local_yum”. - Create a directory named “local_yum”
- Move the RPM package to the local yum repository directory:
Move the downloaded RPM package to the newly created local yum repository directory. - Move the package.rpm file from the /path directory to the /local_yum directory.
- Create and edit a local yum repository configuration file:
Using a text editor in the terminal, such as vim or nano, create a new local yum repository configuration file. For example, create a file named “local.repo”. - Edit the local.repo file located in /etc/yum.repos.d with vim.
- Add the following content to the file:
- [local]
Repository name: Local Yum Repository
Base URL: file:///local_yum
Check for GPG key: Disabled
Enabled: Yes - Save and close the file.
- Clean and update the yum cache by running the following command:
- Clear all yum caches and rebuild the cache.
- Install software package:
Use the following command to install the software package: - Install the package by using the command “yum install package_name”.
- Replace “package_name” with the name of the software package you want to install.
The above are the steps for setting up a local yum repository and installing a software package. Remember to replace “package_name” with the name of the software package you want to install.