我要评分
获取效率
正确性
完整性
易理解

Configuring the Local Yum Source and the Installation Tool

Configuring a Local Yum Source

Configure the local source if the server cannot obtain dependencies from the Internet using yum commands.

  1. Back up the original Yum source configuration files of the system.
    1
    mv /etc/yum.repos.d /etc/yum.repos.d-bak
    
  2. Create the /etc/yum.repos.d directory for the new Yum source.
    1
    mkdir /etc/yum.repos.d
    
  3. Switch to the directory created.
    1
    cd /etc/yum.repos.d
    
  4. Create a file named local.repo and edit it.
    1. Create a file named local.repo.
      1
      vim local.repo
      
    2. Press i to enter the insert mode and add the following content to the local.repo file:
      [local]
      name=local.repo
      baseurl=file:///mnt
      enabled=1
      gpgcheck=0

      The file is edited as follows:

      The file path specified by baseurl indicates the directory to which the image is mounted, that is, the /mnt directory.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  5. Make the local source take effect.
    1
    yum makecache
    

Installing the Tool

Install the tools that need to be used in the subsequent steps:

1
yum -y install git wget