Configuring the Yum Source
- If you have access to the Internet, see Configuring a Yum Source from the Internet. openEuler does not allow configuring a Yum source from the Internet. See Configuring a Local Yum Source.
- If you do not have access to the Internet, see Configuring a Local Yum Source.
Configuring a Yum Source from the Internet
- Check that the Internet connection is normal.
1curl www.baidu.com - Check for the Yum source (*.repo file). If it is available, go to 6.
1ls /etc/yum.repos.d/ - Back up the Yum source.
1 2 3
cd /etc/yum.repos.d mkdir bak mv *.repo bak
- Configure the Yum source.
1wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-AltArch-7.repo
- View the Yum source.
1 2
ls /etc/yum.repos.d/ cat /etc/yum.repos.d/CentOS-Base.repo
- Make the Yum source take effect.
1 2 3
yum clean all yum makecache yum list
Configuring a Local Yum Source
- Download the OS image file.OS image addresses:
- Mount the OS image file.
- Method 1: Upload the OS image file to the /root directory and mount it to the /mnt directory.
- CentOS:
1mount /root/CentOS-7-aarch64-Everything-1810.iso /mnt
- openEuler:
1mount /root/openEuler-20.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.- Open the fstab file.
1vi /etc/fstab - Press i to enter the insert mode, and add the following content to the end of the fstab file:
- CentOS:
1/root/CentOS-7-aarch64-Everything-1810.iso /mnt iso9660 loop 0 0
- openEuler:
1/root/openEuler-20.03-LTS-SP1-everything-aarch64-dvd.iso /mnt iso9660 loop 0 0
- CentOS:
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the fstab file.
- CentOS:
- Method 2: 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.
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 the 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
[local] name=local.repo baseurl=file:///mnt enabled=1 gpgcheck=0
- Press Esc, type :wq!, and press Enter to save the file and exit.
- View 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 Installation Environment