云服务器内容精选

  • 前提条件 HCE中已安装dnf组件,dnf命令可用。 [root@localhost bin]# dnf usage: dnf [options] COMMAND List of Main Commands: alias List or create command aliases autoremove remove all unneeded packages that were originally installed as dependencies check check for problems in the packagedb check-update check for available package upgrades clean remove cached data deplist [deprecated, use repoquery --deplist] List package's dependencies and what packages provide them distro-sync synchronize installed packages to the latest available versions downgrade Downgrade a package ......
  • 升级步骤 检查待更新的RPM包。 执行dnf list updates命令查看所有待更新的RPM包列表。 [root@localhost bin]# dnf list updates Last metadata expiration check: 6:49:11 ago on Tue 28 Jun 2022 01:55:35 PM CS T. 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 执行dnf list updates --security命令,仅查看安全更新涉及的RPM包。 [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 升级待更新的RPM包。 执行dnf update命令升级所有待更新的RPM包,包括安全更新涉及的RPM包和漏洞修复。执行命令输出信息中会显示组件的目标版本信息(Version列)。 [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]: 执行dnf update --security命令,仅升级安全更新涉及的RPM包。 [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! 升级成功后,请及时确认业务运行情况。 升级过程中遇到的常见问题: 安全规范要求chronyd服务在安装/升级后默认处于disabled状态,所以从HCE-2.0.2206版本升级至新版本后,chronyd服务会处于disabled状态。如有需要,您可通过systemctl enable chronyd使能该服务,并通过systemctl start chronyd启动该服务。