Help Center> Huawei Cloud EulerOS> User Guide> Configuring Repo Sources and Installing Software for HCE OS
Updated on 2024-07-02 GMT+08:00

Configuring Repo Sources and Installing Software for HCE OS

HCE OS uses RPM packages to manage software and provides the official repo source matching the OS to release software packages and update packages. You can run the dnf/yum commands for common software management functions, such as installation, upgrade, and uninstallation.

Configuring the Official Repo Source

By default, the official repo source is configured in the /etc/yum.repos.d/hce.repo file of the default HCE OS image purchased through the ECS. Take Huawei Cloud EulerOS 2.0 as an example. The file content is as follows:

[base]
name=HCE $releasever base
baseurl=https://repo.huaweicloud.com/hce/$releasever/os/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.huaweicloud.com/hce/$releasever/os/RPM-GPG-KEY-HCE-2

[updates]
name=HCE $releasever updates
baseurl=https://repo.huaweicloud.com/hce/$releasever/updates/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.huaweicloud.com/hce/$releasever/updates/RPM-GPG-KEY-HCE-2
 
[debuginfo]
name=HCE $releasever debuginfo
baseurl=https://repo.huaweicloud.com/hce/$releasever/ debuginfo/$basearch/
enabled=0
gpgcheck=1
gpgkey=https://repo.huaweicloud.com/hce/$releasever/ debuginfo/RPM-GPG-KEY-HCE-2

The fields are described as follows:

  • name: name of the repo source.
  • baseurl: address of the server where the software repository is located. The value can be in the format of http://, ftp://, or file://.
  • enabled: whether to enable the software repository. The value 1 indicates that the software repository is enabled, and the value 0 indicates that the software repository is disabled.
  • gpgcheck: whether to perform GNU Privacy Guard (GPG) verification. The value 1 indicates that GPG verification is enabled, and the value 0 indicates that GPG verification is disabled.
  • gpgkey: address for storing the public key that is used for GPG verification.

Modifying this file may affect the software installation and upgrade of the OS. You are advised not to modify this file.

Configuring a Third-Party Repo Source

To add a third-party repo source, perform the following steps (the image source from the OpenEuler community is used as an example):

  1. Add the openEuler.repo file to the /etc/yum.repos.d/ directory. The file name can be customized, but the file name extension must be .repo. Run the vim /etc/yum.repo.d/openEuler.repo command to edit the file.
  2. Set the repository name, for example, [openEuler]. The repository name must be unique and can be changed based on site requirements.
  3. Configure the name field. For example, set it to openEuler repository, which is the detailed description of the repository. You can change the description based on site requirements.
  4. Set baseurl to https://repo.openeuler.org/openEuler-22.03-LTS/OS/x86_64/, which is the link where the software package is obtained. For details, see the product documentation of OpenEuler or the repo provider.
  5. Configure the gpgcheck field. The value 1 indicates that GPG verification is performed on the installed software package.
  6. Configure the enabled field. The value 1 indicates that the repo source is enabled.
  7. Set gpgkey to https://repo.openeuler.org/openEuler-22.03-LTS/OS/x86_64/RPM-GPG-KEY-openEuler, which is the link where the public key used for GPG verification is obtained.
The final openEuler.repo file is as follows:
[openEuler]
name=openEuler repository
baseurl=https://repo.openeuler.org/openEuler-22.03-LTS/OS/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://repo.openeuler.org/openEuler-22.03-LTS/OS/x86_64/RPM-GPG-KEY-openEuler

You can set the priority field to specify the priority of each repo source. If the HCE OS official source is preferentially used, add priority=1 to the hce.repo configuration (a smaller value indicates a higher priority), and then add priority=2 to the third-party source configuration. You can adjust the value based on site requirements. For details about the complete openEuler repository configuration, see Obtaining the openEuler Extended Software Packages.

To upgrade the software package, refer to Upgrading Huawei Cloud EulerOS and RPM Packages.

Common yum and dnf Commands

In Huawei Cloud EulerOS 1.1, you can only perform software management operations by running the yum commands. In HCE OS 2.0, both the yum and dnf commands are supported. The following are common commands for software management.

Function

yum Command

dnf Command

Example Command

Installing software packages

yum install <Software package>

dnf install <Software package>

yum install gcc: installs GCC.

Uninstalling software packages

yum remove <Software package>

dnf remove <Software package>

yum remove gcc: uninstalls GCC.

Listing installed software packages

yum list installed

dnf list installed

yum list installed: lists all software packages in the system.

Searching for software packages

yum search <Software package>

dnf search <Software package>

yum search gcc: searches for the GCC package in the repo source.

Querying information about software packages

yum info <Software package>

dnf info <Software package>

yum info gcc: queries GCC software package information.