Installed: rpm-0:4.11.3-48.el7_9.x86_64 at Fri 10 Feb 2023 02:11:48 PM CST Built : CentOS BuildSystem <http://bugs.centos.org> at Wed 24 Nov 2021 04:33:39 PM CST [root@shawnyan ~]#
cd /etc/yum.repos.d mkdir el7 mv *.repo el7 vi rocky.repo
然后执行升级命令。
1
dnf upgrade
不过这样从 CentOS 7 直接升级到 Rocky Linux 8 总是报错,尚未找到合适的解决办法。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Running transaction check Error: transaction check vs depsolve: (gcc >= 8 with gcc < 9) is needed by annobin-10.94-1.el8.x86_64 rpmlib(RichDependencies) <= 4.12.0-1 is needed by annobin-10.94-1.el8.x86_64 (flatpak-selinux = 1.10.7-1.el8 if selinux-policy-targeted) is needed by flatpak-1.10.7-1.el8.x86_64 rpmlib(RichDependencies) <= 4.12.0-1 is needed by flatpak-1.10.7-1.el8.x86_64 (annobin if gcc) is needed by redhat-rpm-config-131-1.el8.noarch (gcc-plugin-annobin if gcc) is needed by redhat-rpm-config-131-1.el8.noarch rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-131-1.el8.noarch (NetworkManager >= 1.20 or dhclient) is needed by dracut-network-049-223.git20230119.el8.x86_64 rpmlib(RichDependencies) <= 4.12.0-1 is needed by dracut-network-049-223.git20230119.el8.x86_64 (selinux-policy >= 3.14.3-98 if selinux-policy) is needed by rng-tools-6.15-3.el8.x86_64 rpmlib(RichDependencies) <= 4.12.0-1 is needed by rng-tools-6.15-3.el8.x86_64 (systemd-standalone-tmpfiles or systemd) is needed by samba-common-0:4.17.5-3.el8_8.noarch rpmlib(RichDependencies) <= 4.12.0-1 is needed by samba-common-0:4.17.5-3.el8_8.noarch To diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'. You probably have corrupted RPMDB, running 'rpm --rebuilddb' might fix the issue. The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'.
Total download size: 50 k Is this ok [y/N]: y Downloading Packages: (1/3): rocky-gpg-keys-8.8-1.8.el8.noarch.rpm 68 kB/s | 13 kB 00:00 (2/3): rocky-release-8.8-1.8.el8.noarch.rpm 107 kB/s | 22 kB 00:00 (3/3): rocky-repos-8.8-1.8.el8.noarch.rpm 62 kB/s | 15 kB 00:00 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 202 kB/s | 50 kB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: rocky-gpg-keys-8.8-1.8.el8.noarch 1/1 Installing : rocky-gpg-keys-8.8-1.8.el8.noarch 1/10 Installing : rocky-release-8.8-1.8.el8.noarch 2/10 Installing : rocky-repos-8.8-1.8.el8.noarch 3/10 Erasing : centos-release-scl-2-3.el7.centos.noarch 4/10 warning: file /etc/yum.repos.d/CentOS-SCLo-scl.repo: remove failed: No such file or directory
Erasing : centos-release-scl-rh-2-3.el7.centos.noarch 5/10 warning: file /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo: remove failed: No such file or directory
Erasing : centos-linux-release-8.5-1.2111.el8.noarch 6/10 Erasing : centos-linux-repos-8-3.el8.noarch 7/10 warning: file /etc/yum.repos.d/CentOS-Linux-Sources.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-PowerTools.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-Plus.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-Media.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-FastTrack.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-Extras.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-Devel.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-Debuginfo.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-BaseOS.repo: remove failed: No such file or directory warning: file /etc/yum.repos.d/CentOS-Linux-AppStream.repo: remove failed: No such file or directory
Complete! [root@shawnyan yum.repos.d]# dnf update --allowerasing Last metadata expiration check: 0:07:35 ago on Wed 25 Oct 2023 12:55:30 AM CST. Dependencies resolved. Nothing to do. Complete! [root@shawnyan yum.repos.d]#
升级后重启系统,并查看版本信息。
1 2 3 4 5
[root@shawnyan yum.repos.d]# cat /etc/redhat-release Rocky Linux release 8.8 (Green Obsidian) [root@shawnyan yum.repos.d]# uname -a Linux shawnyan 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux [root@shawnyan yum.repos.d]# reboot
Rocky 的登陆界面。
可以看到重启前后内核版本发生了变化。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Last login: Wed Oct 25 00:39:04 2023 from 192.168.8.1 [root@shawnyan ~]# cat /etc/redhat-release Rocky Linux release 8.8 (Green Obsidian) [root@shawnyan ~]# uname -a Linux shawnyan 4.18.0-477.27.1.el8_8.x86_64 #1 SMP Wed Sep 20 15:55:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux [root@shawnyan ~]# hostnamectl Static hostname: shawnyan Icon name: computer-vm Chassis: vm Machine ID: e7f51860c9c34455bcb755eac18c8868 Boot ID: 788363ea2b7442c8a5f269aeb2ff2ab2 Virtualization: vmware Operating System: Rocky Linux 8.8 (Green Obsidian) CPE OS Name: cpe:/o:rocky:rocky:8:GA Kernel: Linux 4.18.0-477.27.1.el8_8.x86_64 Architecture: x86-64 [root@shawnyan ~]#
到此,操作系统版本已经从 CentOS 7.9 来到了 Rocky Linux 8.8,接下来,将升级到 Rocky 9。
[root@shawnyan yum.repos.d]# dnf upgrade --allowerasing Last metadata expiration check: 0:00:28 ago on Wed 25 Oct 2023 01:14:48 AM CST. Modular dependency problems:
Problem 1: conflicting requests - nothing provides module(platform:el8) needed by module container-tools:rhel8:8080020231004143727:8108cfbc.x86_64 Problem 2: conflicting requests - nothing provides module(platform:el8) needed by module go-toolset:rhel8:8080020230629185105:17f3f959.x86_64 Problem 3: conflicting requests - nothing provides module(platform:el8) needed by module idm:client:8080020230516222414:152c1be2.x86_64 Problem 4: conflicting requests - nothing provides module(platform:el8) needed by module llvm-toolset:rhel8:8080020230201094332:fd72936b.x86_64 Problem 5: conflicting requests - nothing provides module(platform:el8) needed by module swig:3.0:8040020210530171044:9f9e2e7e.x86_64 Problem 6: conflicting requests - nothing provides module(platform:el8) needed by module virt:rhel:8080020230922173645:fd72936b.x86_64 Dependencies resolved. ============================================================================================================================================================================================================================================ Package Architecture Version Repository Size ============================================================================================================================================================================================================================================ Installing:
Total download size: 844 M Is this ok [y/N]: y ... Upgrading : dracut-057-21.git20230214.el9.x86_64 803/2347 Installing : kernel-modules-core-5.14.0-284.30.1.el9_2.x86_64 804/2347 Installing : kernel-core-5.14.0-284.30.1.el9_2.x86_64 805/2347 Running scriptlet: kernel-core-5.14.0-284.30.1.el9_2.x86_64 805/2347 ... Complete!
安装完成,可以看到 kernel 版本已经来到了 5.14,重启系统并查看版本信息。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[root@shawnyan yum.repos.d]# cat /etc/redhat-release Rocky Linux release 9.2 (Blue Onyx) [root@shawnyan yum.repos.d]# uname -a Linux shawnyan 4.18.0-477.27.1.el8_8.x86_64 #1 SMP Wed Sep 20 15:55:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux [root@shawnyan yum.repos.d]# hostnamectl Static hostname: shawnyan Icon name: computer-vm Chassis: vm 🖴 Machine ID: e7f51860c9c34455bcb755eac18c8868 Boot ID: 788363ea2b7442c8a5f269aeb2ff2ab2 Virtualization: vmware Operating System: Rocky Linux 9.2 (Blue Onyx) CPE OS Name: cpe:/o:rocky:rocky:9::baseos Kernel: Linux 4.18.0-477.27.1.el8_8.x86_64 Architecture: x86-64 Firmware Version: 6.00 [root@shawnyan yum.repos.d]# reboot