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:

  1. 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.
  2. 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”.
  3. Create a directory named “local_yum”
  4. Move the RPM package to the local yum repository directory:
    Move the downloaded RPM package to the newly created local yum repository directory.
  5. Move the package.rpm file from the /path directory to the /local_yum directory.
  6. 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”.
  7. Edit the local.repo file located in /etc/yum.repos.d with vim.
  8. Add the following content to the file:
  9. [local]
    Repository name: Local Yum Repository
    Base URL: file:///local_yum
    Check for GPG key: Disabled
    Enabled: Yes
  10. Save and close the file.
  11. Clean and update the yum cache by running the following command:
  12. Clear all yum caches and rebuild the cache.
  13. Install software package:
    Use the following command to install the software package:
  14. Install the package by using the command “yum install package_name”.
  15. 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.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds