Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the Local Yum Source

Configure the Yum source properly to install the required software and dependencies.

  1. Download the OS image file.
  2. Mount the OS image file.
    • Method 1: Upload the OS image file to the /root directory and mount it to the /mnt directory.
      • On CentOS 7.6:
        1
        mount /root/CentOS-7-aarch64-Everything-1810.iso /mnt
        
      • On CentOS 8.1:
        1
        mount /root/CentOS-8.1.1911-aarch64-dvd1.iso /mnt
        
      • openEuler 20.03:
        1
        mount /root/openEuler-20.03-LTS-SP1-everything-aarch64-dvd.iso /mnt
        
      • openEuler 22.03:
        mount /root/openEuler-22.03-LTS-SP1-everything-aarch64-dvd.iso /mnt
      Rename the ISO file based on your requirements. The renaming operation takes effect only once and becomes invalid after a system restart. You can perform the following operations for the image file to be automatically mounted upon system startup.
      1. Open the fstab file.
        1
        vim /etc/fstab
        
      2. Press i to enter the insert mode, and add the following content to the end of the fstab file:
        • CentOS 7.6:
          1
          /root/CentOS-7-aarch64-Everything-1810.iso /mnt iso9660 loop 0 0
          
        • CentOS 8.1:
          1
          /root/CentOS-8.1.1911-aarch64-dvd1.iso /mnt iso9660 loop 0 0
          
        • openEuler 20.03:
          1
          /root/openEuler-20.03-LTS-SP1-everything-aarch64-dvd.iso /mnt iso9660 loop 0 0
          
        • openEuler 22.03:
          /root/openEuler-22.03-LTS-SP1-everything-aarch64-dvd.iso /mnt iso9660 loop 0 0
      3. Press Esc, type :wq!, and press Enter to save the file and exit.
    • Method 2: Use a browser to log in to the BMC and use the KVM to load the OS image file to the /mnt directory.
      1. Check the device symbol corresponding to the OS image.
        ls /dev/sr*
      2. Mount the OS image file to the /mnt directory.
        mount /dev/sr0 /mnt
        df -h | grep /mnt
        ls /mnt/

        /dev/sr0 is the device symbol corresponding to the OS image, which must be the same as that queried in 2.a.

  3. Back up the Yum source.
    1
    2
    3
    cd /etc/yum.repos.d
    mkdir bak
    mv *.repo bak
    
  4. Configure the local Yum source.
    1. Go to the /etc/yum.repos.d directory.
      1
      cd /etc/yum.repos.d
      
    2. Create a local.repo file.
      1. Open the local.repo file.
        1
        vim local.repo
        
      2. Press i to enter the insert mode and add the following content to the local.repo file:
         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        [local-BaseOS]
        name=local.repo
        baseurl=file:///mnt/BaseOS/
        enabled=1
        gpgcheck=0
        [local-AppStream]
        name=local.repo
        baseurl=file:///mnt/AppStream/
        enabled=1
        gpgcheck=0
        

        The file path in baseurl is the image mount path, which is the /mnt directory in 2.

      3. Press Esc, type :wq!, and press Enter to save the file and exit.
      4. View the local.repo file.
        cat local.repo
  5. Make the Yum source take effect.
    1
    2
    3
    yum clean all
    yum makecache
    yum list