Configuring a Yum Repository
Configure a Yum repository properly for subsequent installation of the required software and dependencies.
- If you have access to the Internet, see Configuring an Internet Yum Repository.
- If you do not have access to the Internet, see Configuring a Local Yum Repository.
Configuring an Internet Yum Repository
- Run the curl command to access any website. If the website information is displayed, the proxy is successfully configured and the Internet is connected.
- Check for the Yum repositories (.repo files). If an Internet repository is available, go to 7.
1ls /etc/yum.repos.d/ - Back up the Yum repository to the bak directory.
1 2 3
cd /etc/yum.repos.d mkdir bak mv *.repo bak
- Open the file.
1vi /etc/yum.repos.d/openEuler.repo - Press i to enter the insert mode.
- If the OS is openEuler 22.03 LTS SP4, modify the file content as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[openEuler-everything] name=openEuler-everything baseurl=http://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP4/everything/aarch64/ enabled=1 gpgcheck=0 gpgkey=http://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP4/everything/aarch64/RPM-GPG-KEY-openEuler [openEuler-EPOL] name=openEuler-epol baseurl=http://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP4/EPOL/main/aarch64/ enabled=1 gpgcheck=0 [openEuler-update] name=openEuler-update baseurl=http://repo.huaweicloud.com/openeuler/openEuler-22.03-LTS-SP4/update/aarch64/ enabled=1 gpgcheck=0
- If the OS is openEuler 24.03 LTS SP3, modify the file content as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
[openEuler-everything] name=openEuler-everything baseurl=http://repo.huaweicloud.com/openeuler/openEuler-24.03-LTS-SP3/everything/aarch64/ enabled=1 gpgcheck=0 gpgkey=http://repo.huaweicloud.com/openeuler/openEuler-24.03-LTS-SP3/everything/aarch64/RPM-GPG-KEY-openEuler [openEuler-EPOL] name=openEuler-epol baseurl=http://repo.huaweicloud.com/openeuler/openEuler-24.03-LTS-SP3/EPOL/main/aarch64/ enabled=1 gpgcheck=0 [openEuler-update] name=openEuler-update baseurl=http://repo.huaweicloud.com/openeuler/openEuler-24.03-LTS-SP3/update/aarch64/ enabled=1 gpgcheck=0
- If the OS is openEuler 22.03 LTS SP4, modify the file content as follows:
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Make the Yum repository take effect.
1 2 3
yum clean all yum makecache yum list
Configuring a Local Yum Repository
- Download the OS image file.
- Mount the OS image file.
- Method 1: Upload the OS image file to the /root directory and mount it to the /mnt directory.
- openEuler 22.03
1mount /root/openEuler-22.03-LTS-SP4-everything-aarch64-dvd.iso /mnt
- openEuler 24.03
1mount /root/openEuler-24.03-LTS-SP3-everything-aarch64-dvd.iso /mnt
Replace the ISO file name with the actual one. This operation takes effect only once and becomes invalid after the OS is restarted.
- openEuler 22.03
- Method 2: Enable the OS image file to be automatically mounted upon server startup.
- 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.
- openEuler 22.03
1/root/openEuler-22.03-LTS-SP4-everything-aarch64-dvd.iso /mnt iso9660 loop 0 0
- openEuler 24.03
1/root/openEuler-24.03-LTS-SP3-everything-aarch64-dvd.iso /mnt iso9660 loop 0 0
Replace the ISO file name with the actual one.
- openEuler 22.03
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the fstab file.
- Method 3: Use a browser to log in to the BMC and use the KVM to load the OS image file.
- Check the device symbol corresponding to the OS image.
1ls /dev/sr* - Mount the OS image file to the /mnt directory.
1 2 3
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 repository.
1 2 3
cd /etc/yum.repos.d mkdir bak mv *.repo bak
- Configure a local Yum repository.
- Go to the /etc/yum.repos.d directory.
1cd /etc/yum.repos.d
- Open the local.repo file.
1vim local.repo - Press i to enter the insert mode and add the following content to the file:
1 2 3 4 5
[local] name=local.repo baseurl=file:///mnt enabled=1 gpgcheck=0
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Check the local.repo file.
1cat local.repo
- Go to the /etc/yum.repos.d directory.
- Make the Yum repository take effect.
1 2 3
yum clean all yum makecache yum list
Parent topic: Compilation Environment Configuration