Configuring a Yum Source
Configure a Yum source properly to install the required software and dependencies.
- 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 the Internet connection is unavailable, see Configuring a Local Yum Source.
Configuring a Yum Source from the Internet
- 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 source (*.repo file). If it is available, go to 5.
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.
- Open the file.
1vi openEuler.repo - Press i to enter the insert mode and modify the file as follows:
[OS] name=OS baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/OS/$basearch/ metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/OS&arch=$basearch metadata_expire=1h enabled=1 gpgcheck=1 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/OS/$basearch/RPM-GPG-KEY-openEuler [everything] name=everything baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/everything/$basearch/ metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/everything&arch=$basearch metadata_expire=1h enabled=1 gpgcheck=1 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/everything/$basearch/RPM-GPG-KEY-openEuler [EPOL] name=EPOL baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/EPOL/main/$basearch/ metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/EPOL/main&arch=$basearch metadata_expire=1h enabled=1 gpgcheck=1 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/OS/$basearch/RPM-GPG-KEY-openEuler [debuginfo] name=debuginfo baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/debuginfo/$basearch/ metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/debuginfo&arch=$basearch metadata_expire=1h enabled=1 gpgcheck=1 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP2/debuginfo/$basearch/RPM-GPG-KEY-openEuler [source] name=source baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/source/ metalink=https://mirrors.openeuler.org/metalink?repo=$releasever&arch=source metadata_expire=1h enabled=1 gpgcheck=1 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/source/RPM-GPG-KEY-openEuler [update] name=update baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/update/$basearch/ metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/update&arch=$basearch metadata_expire=1h enabled=1 gpgcheck=1 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/OS/$basearch/RPM-GPG-KEY-openEuler [update-source] name=update-source baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/update/source/ metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/update&arch=source metadata_expire=1h enabled=1 gpgcheck=1 gpgkey=http://repo.openeuler.org/openEuler-22.03-LTS-SP4/source/RPM-GPG-KEY-openEuler
If openEuler 20.03 LTS SP1 for AArch64 is used, replace openEuler-22.03-LTS-SP4 with openEuler-20.03-LTS-SP1 in the preceding commands.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- 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.
For the download address, see Table 2.
- 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:
1mount /root/openEuler-22.03-LTS-SP4-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 7.6:
1/root/CentOS-7-aarch64-Everything-1810.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:
1/root/openEuler-22.03-LTS-SP4-everything-aarch64-dvd.iso /mnt iso9660 loop 0 0
- CentOS 7.6:
- 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.
- 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.
1cat 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