[email protected]升级9.5(小版本升级)

Rocky Linux 是一个社区驱动的企业级操作系统,旨在与 Red Hat Enterprise Linux (RHEL) 兼容

升级前

1.检查当前系统内核及操作系统版本
uname -r && cat /etc/os-release
5.14.0-427.13.1.el9_4.x86_64  ### 内核版本
NAME="Rocky Linux"
VERSION="9.4 (Blue Onyx)"  ### 当前发行版本
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"

升级中

1.升级命令参数解释

dnf --help
    ...
    upgrade                   upgrade a package or packages on your system  ### 升级当前系统包
    distro-sync               synchronize installed packages to the latest available versions  ### 同步安装最新包

  --refresh             set metadata as expired before running the command  ### 当前缓冲包元数据过期,拉取最新的

2.更新现有系统

sudo dnf upgrade --refresh
sudo dnf distro-sync

[root@vgt-rocky9-60 ~]# sudo dnf distro-sync
Last metadata expiration check: 0:07:24 ago on Tue 29 Apr 2025 06:31:02 AM UTC.
Dependencies resolved.
Nothing to do.
Complete!

3.检查内核及系统信息

[root@vgt-rocky9-60 ~]# uname -r &&  cat /etc/os-release 
5.14.0-427.13.1.el9_4.x86_64
NAME="Rocky Linux"
VERSION="9.5 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.5"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.5 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
VENDOR_NAME="RESF"
VENDOR_URL="https://resf.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.5"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.5"

4.重启系统

sudo reboot

升级后

1.检查升级后内核及系统信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

uname -r && cat /etc/os-release

[root@vgt-rocky9-60 ~]# uname -r && cat /etc/os-release
5.14.0-503.38.1.el9_5.x86_64
NAME="Rocky Linux"
VERSION="9.5 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.5"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.5 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
VENDOR_NAME="RESF"
VENDOR_URL="https://resf.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.5"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.5"

2.清理旧的软件包

sudo dnf autoremove
sudo dnf clean all

3.重启系统

sudo reboot