Help Center/ Huawei Cloud EulerOS/ User Guide/ Upgrading HCE and RPM Packages/ Using dnf or yum for Upgrade and Rollback
Updated on 2025-09-19 GMT+08:00

Using dnf or yum for Upgrade and Rollback

This section describes how to update or roll back HCE 1.1. The methods of using dnf and yum are the same. In this section, dnf is used as an example.

  • HCE 2.0 and later support both yum and dnf.
  • HCE 1.1 supports only yum.

Context

Dandified YUM (DNF) and Yellowdog Updater Modified (YUM) are RPM-based package management tools used to install, update, and remove software packages. YUM is an earlier tool, while DNF is its successor. DNF aims to provide better performance and more functions, such as modules and parallel download. Both yum and dnf commands can be used by HCE to achieve better compatibility.

Upgrade Procedure

  1. Check what RPM package updates are available.
    • Run dnf list updates to see the available updates.
      [root@localhost bin]# dnf list updates 
      Last metadata expiration check: 6:49:11 ago on Tue 28 Jun 2022 01:55:35 PM CST.  
      hce-config.x86_64                           3.0-66.hce2                
      hce-latest-release.x86_64                   2.0-1656179342.2.0.2206.B032.hce2 
      irqbalance.x86_64                           3:1.8.0-7.h9.hce2  
      kernel.x86_64                               5.10.0-60.18.0.50.h316_1.hce2
      kernel-tools.x86_64                         5.10.0-60.18.0.50.h316_1.hce2 
      kernel-tools-libs.x86_64                    5.10.0-60.18.0.50.h316_1.hce2
      kexec-tools.x86_64                          2.0.23-4.h8.hce2 
      libcurl.x86_64                              7.79.1-2.h4.hce2 
      libssh.x86_64                               0.9.6-2.h3.hce2 
      libstdc++.x86_64                            10.3.1-10.h10.hce2 
      libxml2.x86_64                              2.9.12-5.h5.hce2  
      openssh.x86_64                              8.8p1-2.h12.hce2 
      openssh-clients.x86_64                      8.8p1-2.h12.hce2 
      openssh-server.x86_64                       8.8p1-2.h12.hce2  
      Obsoleting Packages 
      dnf-data.noarch                             4.10.0-3.h6.hce2      
      dnf.noarch                                  4.10.0-3.h5.hce2  
      dnf-data.noarch                             4.10.0-3.h6.hce2    
      dnf-data.noarch                             4.10.0-3.h5.hce2
    • Run dnf list updates --security to list only the RPM packages related to security updates.
      [root@localhost bin]# dnf list updates --security 
      Last metadata expiration check: 0:00:03 ago on Fri 08 Jul 2022 04:45:56 PM CST. 
      No security updates needed, but 2 updates available
  2. Update the RPM packages.
    • Run dnf update to update all the RPM packages, including those related to security updates for vulnerability fixing. The components' target versions are returned to the Version column.
      [root@localhost bin]# dnf update 
      Last metadata expiration check: 7:12:18 ago on Tue 28 Jun 2022 01:55:35 PM CST. 
      Dependencies resolved. 
      ================================================================================================  
       Package                        Arch      Version                                 Repo     Size ================================================================================================ 
      Installing:  
       kernel                         x86_64    5.10.0-60.18.0.50.h316_1.hce2           hce2     47 M 
      Upgrading:  
       hce-config                     x86_64    3.0-66.hce2                             hce2     13 k 
       hce-latest-release             x86_64    2.0-1656179342.2.0.2206.B032.hce2       hce2    5.2 k 
       kernel-tools                   x86_64    5.10.0-60.18.0.50.h316_1.hce2           hce2    230 k 
       kernel-tools-libs              x86_64    5.10.0-60.18.0.50.h316_1.hce2           hce2     62 k 
       kexec-tools                    x86_64    2.0.23-4.h8.hce2                        hce2    400 k 
       libcurl                        x86_64    7.79.1-2.h4.hce2                        hce2    284 k 
       libssh                         x86_64    0.9.6-2.h3.hce2                         hce2    194 k 
       libstdc++                      x86_64    10.3.1-10.h10.hce2                      hce2    535 k 
       libxml2                        x86_64    2.9.12-5.h5.hce2                        hce2    659 k  
       logrotate                      x86_64    3.18.1-1.h2.hce2                        hce2     60 k 
       mdadm                          x86_64    4.1-5.h2.hce2                           hce2    331 k 
       nftables                       x86_64    1:1.0.0-1.h3.hce2                       hce2    303 k 
       perl                           x86_64    4:5.34.0-3.h5.hce2                      hce2    3.2 M 
       perl-libs                      x86_64    4:5.34.0-3.h5.hce2                      hce2    1.8 M 
      Installing dependencies: 
       grub2-tools-efi                x86_64    1:2.06-3.h5.hce2                        hce2    472 k 
      
       Transaction Summary 
      ================================================================================================ 
      Install   2 Packages 
      Upgrade  72 Packages  
      Total download size: 105 M 
      Is this ok [y/N]:
    • Run dnf update --security to update only the RPM packages related to security updates.
      [root@localhost bin]# dnf update --security 
      Last metadata expiration check: 7:15:16 ago on Tue 28 Jun 2022 01:55:35 PM CST. 
      No security updates needed, but 73 updates available Dependencies resolved. 
      Nothing to do. 
      Complete!
  3. After the update is successful, check that services are running properly.

Rollback Procedure

  1. Run dnf history to query the IDs of historical operations.
    Figure 1 Querying the IDs of historical operations
  2. Run dnf history undo <ID> to roll back to the desired historical operation.