Configuring an HCE Repository
HCE software is managed through RPM packages. By default, an official HCE repository is provided to release and update packages. You can use DNF or YUM commands for software management, such as installation, upgrade, and uninstallation.
Official Repository
By default, an official repository is configured in the /etc/yum.repos.d/hce.repo file of an HCE image. Take HCE 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 repository.
- baseurl: address of the repository server. The value can be in the format of http://, ftp://, or file://.
- enabled: whether to enable the repository. 1 indicates the repository is enabled. 0 indicates the repository is disabled.
- gpgcheck: whether to enable GNU Privacy Guard (GPG) verification. 1 indicates GPG verification is enabled. 0 indicates GPG verification is disabled.
- gpgkey: address for storing the public key that is used for GPG verification.

Modifying this file may affect software installation and updates. You are not advised to modify this file.
Configuring a Third-Party Repository
To add a third-party repository for HCE 2.0, perform the following steps (OpenEuler is used as an example):
- 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 vim /etc/yum.repos.d/openEuler.repo to edit the file.
- Set the repository name, for example, openEuler-everything. The repository name must be unique and can be changed based on site requirements.
- Configure the name field. For example, set it to openEuler everything repository, which is the detailed description of the repository. You can change the description based on site requirements.
- Set baseurl to https://repo.openeuler.org/openEuler-22.03-LTS/everything/x86_64, which is the URL for obtaining packages. For details, see the official documentation of OpenEuler. If you are using other third-party repository, see the official documentation of that repository provider.
- Configure the gpgcheck field. 1 indicates GPG verification will be performed on packages to be installed.
- Configure the enabled field. 1 indicates the repository is enabled.
- Set gpgkey to https://repo.openeuler.org/openEuler-22.03-LTS/everything/x86_64/RPM-GPG-KEY-openEuler, which is the link where the public key used for GPG verification is obtained.
[openEuler-everything] name=openEuler everything repository baseurl=https://repo.openeuler.org/openEuler-22.03-LTS/everything/x86_64 gpgcheck=1 enabled=1 priority=3 gpgkey=https://repo.openeuler.org/openEuler-22.03-LTS/everything/x86_64/RPM-GPG-KEY-openEuler [openEuler-update] name=openEuler update repository baseurl=https://repo.openeuler.org/openEuler-22.03-LTS/update/x86_64/ gpgcheck=1 enabled=1 priority=3 gpgkey=https://repo.openeuler.org/openEuler-22.03-LTS/everything/x86_64/RPM-GPG-KEY-openEuler

You can use priority to set the priority of each repository. To use the default HCE repository preferentially, add priority=1 to the hce.repo configuration file (a smaller value indicates a higher priority). Then, add priority=2 to the configuration file of a third-party repository. priority=2 is an example only. You can adjust the value based on site requirements.
Common YUM and DNF Commands
In HCE 1.1, you can only use YUM commands. In HCE 2.0, both YUM and DNF commands can be used. The following are common commands for software management.
Function |
YUM |
DNF |
Example |
---|---|---|---|
Installing a package |
yum install <Software package> |
dnf install <Software package> |
yum install gcc |
Uninstalling a package |
yum remove <Software package> |
dnf remove <Software package> |
yum remove gcc |
Listing installed software packages |
yum list installed |
dnf list installed |
yum list installed |
Searching for a package |
yum search <Software package> |
dnf search <Software package> |
yum search gcc |
Querying information about a package |
yum info <Software package> |
dnf info <Software package> |
yum info gcc |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot