Configuring the Local Yum Source
Configure the Yum source properly to install the required software and dependencies. If the Internet access is available, skip this section.
- Download an OS image file.OS image addresses:
- CentOS 7.6 image: https://mirrors.huaweicloud.com/centos-vault/altarch/7.6.1810/isos/aarch64/CentOS-7-aarch64-Everything-1810.iso
- openEuler 22.03 LTS SP2 image: https://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP2/ISO/aarch64/openEuler-22.03-LTS-SP2-everything-aarch64-dvd.iso
- openEuler 20.03 LTS SP1 image: https://repo.huaweicloud.com/openeuler/openEuler-20.03-LTS-SP1/ISO/aarch64/openEuler-20.03-LTS-SP1-everything-aarch64-dvd.iso
- Mount the OS image file.
- Method 1: Upload the OS image file to the /root directory and mount it to the /mnt directory.
- CentOS 7.6:
1mount /root/CentOS-7-aarch64-Everything-1810.iso /mnt
- openEuler 20.03:
1mount /root/openEuler-20.03-LTS-SP1-everything-aarch64-dvd.iso /mnt
- openEuler 22.03:
mount /root/openEuler-22.03-LTS-SP2-everything-aarch64-dvd.iso /mnt
The mounted OS image file takes effect only once and becomes invalid after the OS is restarted. Perform the following operations to automatically mount the OS image file upon system startup. Change the ISO file name as required.- Open the fstab file:
1vim /etc/fstab - Press i to enter the insert mode and add the following content to the end of the file.
1/root/CentOS-7-aarch64-Everything-1810.iso /mnt iso9660 loop 0 0
- Press Esc, type :wq!, and press Enter to save the file and exit.
- CentOS 7.6:
- 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.
- Check the device symbol corresponding to the OS image.
ls /dev/sr*
- 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.
- Check the device symbol corresponding to the OS image.
- Method 1: Upload the OS image file to the /root directory and mount it to the /mnt directory.
- Back up the Yum source.
1 2 3
cd /etc/yum.repos.d mkdir bak mv *.repo bak
- Configure a local Yum source.
- Go to the /etc/yum.repos.d directory.
1cd /etc/yum.repos.d
- Create a local.repo file.
- Open the local.repo file.
1vim local.repo - 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
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Check the local.repo file.
cat local.repo
- Open the local.repo file.
- Go to the /etc/yum.repos.d directory.
- Make the Yum source take effect.
1 2 3
yum clean all yum makecache yum list
Parent topic: Configuring the Compilation Environment