Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring a Yum Repository

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

Configuring a Yum Repository from the Internet

  1. Run the curl command to access any website. If the website information is displayed, the proxy is successfully configured and the Internet is connected.
  2. Check the Yum repository. If an Internet Yum repository exists (a .repo file exists and the Yum repository address is specified in the file), go to 7.
    1
    ls /etc/yum.repos.d/
    
  3. Back up the Yum repository to the bak directory.
    1
    2
    3
    cd /etc/yum.repos.d
    mkdir bak
    mv *.repo bak
    
  4. Open the following file.
    1
    vi /etc/yum.repos.d/openEuler.repo
    
  5. Press i to enter the insert mode and configure the file as follows:
    [OS]
    name=OS
    baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP3/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-SP3/OS/$basearch/RPM-GPG-KEY-openEuler
    
    [everything]
    name=everything
    baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP3/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-SP3/everything/$basearch/RPM-GPG-KEY-openEuler
    
    [EPOL]
    name=EPOL
    baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP3/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-SP3/OS/$basearch/RPM-GPG-KEY-openEuler
    
    [debuginfo]
    name=debuginfo
    baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP3/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-SP3/debuginfo/$basearch/RPM-GPG-KEY-openEuler
    
    [source]
    name=source
    baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP3/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-SP3/source/RPM-GPG-KEY-openEuler
    
    [update]
    name=update
    baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP3/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-SP3/OS/$basearch/RPM-GPG-KEY-openEuler
    
    [update-source]
    name=update-source
    baseurl=http://repo.openeuler.org/openEuler-22.03-LTS-SP3/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-SP3/source/RPM-GPG-KEY-openEuler
  6. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  7. Make the Yum repository take effect.
    1
    2
    3
    yum clean all
    yum makecache
    yum list
    

Configuring a Local Yum Repository

If an Internet Yum repository has been configured, skip this section.

  1. Download the full repository (the "everything" version) of the openEuler OS.
    1
    wget https://repo.openeuler.org/openEuler-22.03-LTS-SP3/ISO/aarch64/openEuler-22.03-LTS-SP3-everything-aarch64-dvd.iso
    
  2. Mounting the OS Image
    • Upload the OS image file to the /root directory and mount it to the /mnt directory.
      1
      mount /root/openEuler-22.03-LTS-SP3-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 file.
        1
        /root/openEuler-22.03-LTS-SP3-everything-aarch64-dvd.iso /mnt iso9660 loop 0 0
        
      3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Back up the Yum repository.
    1
    2
    3
    cd /etc/yum.repos.d
    mkdir bak
    mv *.repo bak
    
  4. Configure the local Yum repository.
    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 file:
        1
        2
        3
        4
        5
        [local]
        name=local.repo
        baseurl=file:///mnt
        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. Check the local.repo file.
        1
        cat local.repo
        
  5. Make the Yum repository take effect.
    1
    2
    3
    yum clean all
    yum makecache
    yum list