Kernel , kernel devel and kernel headers are mismatch

Hi :slight_smile:
I just updated the kernel on Rocky Linux 9, the new kernel is 21, but installed kernel header and devel is 22, I tried to install kernel-header 21 but not found, then I tried to install kernel 22 also not found. Please see below

[j@jscomp ~]$ dnf list kernel
Last metadata expiration check: 0:03:55 ago on Thu 19 Jun 2025 02:51:24 PM BST.
Installed Packages
kernel.x86_64                   5.14.0-503.34.1.el9_5                    @baseos
kernel.x86_64                   5.14.0-570.21.1.el9_6                    @baseos
[j@jscomp ~]$ sudo dnf install kernel-devel
Last metadata expiration check: 0:04:45 ago on Thu 19 Jun 2025 02:50:57 PM BST.
Package kernel-devel-5.14.0-570.22.1.el9_6.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[j@jscomp ~]$ sudo dnf install kernel-devel-5.14.0-570.21.1.el9_6.x86_64
Last metadata expiration check: 0:05:13 ago on Thu 19 Jun 2025 02:50:57 PM BST.
No match for argument: kernel-devel-5.14.0-570.21.1.el9_6.x86_64
Error: Unable to find a match: kernel-devel-5.14.0-570.21.1.el9_6.x86_64

[j@jscomp ~]$ sudo dnf install kernel-5.14.0-570.22.1.el9_6
Last metadata expiration check: 0:17:16 ago on Thu 19 Jun 2025 02:50:57 PM BST.
No match for argument: kernel-5.14.0-570.22.1.el9_6
Error: Unable to find a match: kernel-5.14.0-570.22.1.el9_6

[j@jscomp ~]$ sudo dnf install kernel-devel-$(uname -r)
Last metadata expiration check: 0:12:58 ago on Thu 19 Jun 2025 02:50:57 PM BST.
No match for argument: kernel-devel-5.14.0-570.21.1.el9_6.x86_64
Error: Unable to find a match: kernel-devel-5.14.0-570.21.1.el9_6.x86_64

I checked the forum and tried ‘sudo dnf clean all’ and 'sudo dnf update" , not work.

[j@jscomp ~]$ rpm -qa kernel\* | sort
kernel-5.14.0-503.34.1.el9_5.x86_64
kernel-5.14.0-570.21.1.el9_6.x86_64
kernel-core-5.14.0-503.34.1.el9_5.x86_64
kernel-core-5.14.0-570.21.1.el9_6.x86_64
kernel-devel-5.14.0-570.22.1.el9_6.x86_64
kernel-headers-5.14.0-570.22.1.el9_6.x86_64
kernel-modules-5.14.0-503.34.1.el9_5.x86_64
kernel-modules-5.14.0-570.21.1.el9_6.x86_64
kernel-modules-core-5.14.0-503.34.1.el9_5.x86_64
kernel-modules-core-5.14.0-570.21.1.el9_6.x86_64

I would really appreciate your help, I need to update this to install the driver. Thank you a lot in advance!

Rocky Linux 9 at this time does not provide older packages. kernel-5.14.0-570.22.1.el9_6 is the latest.

If you absolutely need the older version, then obtain it from the vault.

Hi thank you for your reply :slight_smile: I understand I just need anything that can work, I updated the computer today (when restart, install the software update click on), and it automatically give me this 21 version. I saw from another post that only latest one is available so I do :


[j@jscomp ~]$ sudo dnf install kernel-5.14.0-570.22.1.el9_6
Last metadata expiration check: 0:23:25 ago on Thu 19 Jun 2025 02:50:57 PM BST.
No match for argument: kernel-5.14.0-570.22.1.el9_6
Error: Unable to find a match: kernel-5.14.0-570.22.1.el9_6
[j@jscomp ~]$ sudo dnf install kernel
Last metadata expiration check: 0:23:35 ago on Thu 19 Jun 2025 02:50:57 PM BST.
Package kernel-5.14.0-503.34.1.el9_5.x86_64 is already installed.
Package kernel-5.14.0-570.21.1.el9_6.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

I found this website : Rocky Linux Release and Version Guide - Rocky Linux Wiki but not really clear to me how can i install the latest one.

Could you tell me how to install 22 please? Thank you

I understand now. It should be as simple as a dnf install or a dnf update. It is likely the mirrors you’re connecting to do not yet have the newest packages.

[root@cm02 ~]# dnf update
Last metadata expiration check: 3:03:12 ago on Thu 19 Jun 2025 04:26:33 AM MST.
Dependencies resolved.
================================================================================================================================================================
 Package                                     Architecture                 Version                                         Repository                       Size
================================================================================================================================================================
Installing:
 kernel                                      x86_64                       5.14.0-570.22.1.el9_6                           baseos                          1.8 M
 kernel-core                                 x86_64                       5.14.0-570.22.1.el9_6                           baseos                           18 M
 kernel-modules                              x86_64                       5.14.0-570.22.1.el9_6                           baseos                           39 M
 kernel-modules-core                         x86_64                       5.14.0-570.22.1.el9_6                           baseos                           31 M
Upgrading:
 buildah                                     x86_64                       2:1.39.4-2.el9_6                                appstream                        11 M
 centpkg                                     noarch                       0.10.0-3.el9                                    epel                             69 k
 distribution-gpg-keys                       noarch                       1.112-1.el9                                     epel                            666 k
 dracut                                      x86_64                       057-88.git20250311.el9_6                        baseos                          385 k
 dracut-config-rescue                        x86_64                       057-88.git20250311.el9_6                        baseos                           12 k
 dracut-network                              x86_64                       057-88.git20250311.el9_6                        baseos                           68 k
 dracut-squash                               x86_64                       057-88.git20250311.el9_6                        baseos                           12 k
 glibc                                       x86_64                       2.34-168.el9_6.19                               baseos                          1.9 M
 glibc-common                                x86_64                       2.34-168.el9_6.19                               baseos                          295 k
 glibc-gconv-extra                           x86_64                       2.34-168.el9_6.19                               baseos                          1.5 M
 glibc-langpack-en                           x86_64                       2.34-168.el9_6.19                               baseos                          552 k
 ipa-client                                  x86_64                       4.12.2-14.el9_6.1                               appstream                       133 k
 ipa-client-common                           noarch                       4.12.2-14.el9_6.1                               appstream                        44 k
 ipa-common                                  noarch                       4.12.2-14.el9_6.1                               appstream                       686 k
 ipa-selinux                                 noarch                       4.12.2-14.el9_6.1                               appstream                        39 k
 kernel-tools                                x86_64                       5.14.0-570.22.1.el9_6                           baseos                          2.0 M
 kernel-tools-libs                           x86_64                       5.14.0-570.22.1.el9_6                           baseos                          1.8 M
 podman                                      x86_64                       5:5.4.0-10.el9_6                                appstream                        17 M
 python3-ipaclient                           noarch                       4.12.2-14.el9_6.1                               appstream                       498 k
 python3-ipalib                              noarch                       4.12.2-14.el9_6.1                               appstream                       602 k
Removing:
 kernel                                      x86_64                       5.14.0-503.31.1.el9_5                           @baseos                           0
 kernel-core                                 x86_64                       5.14.0-503.31.1.el9_5                           @baseos                          66 M
 kernel-modules                              x86_64                       5.14.0-503.31.1.el9_5                           @baseos                          34 M
 kernel-modules-core                         x86_64                       5.14.0-503.31.1.el9_5                           @baseos                          27 M

Transaction Summary
================================================================================================================================================================
Install   4 Packages
Upgrade  20 Packages
Remove    4 Packages

Total download size: 128 M
Is this ok [y/N]: 

Can you confirm the mirrors you are connecting to? sudo dnf repolist -v should give you details on that.

Hi thank you for the reply, please see below:

[j@jscomp ~]$ sudo dnf update
Last metadata expiration check: 0:54:09 ago on Thu 19 Jun 2025 02:50:57 PM BST.
Dependencies resolved.
Nothing to do.
Complete!
[j@jscomp ~]$ sudo dnf repolist -v
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, kpatch, needs-restarting, notify-packagekit, playground, repoclosure, repodiff, repograph, repomanage, reposync, system-upgrade
DNF version: 4.14.0
cachedir: /var/cache/dnf
Last metadata expiration check: 0:54:16 ago on Thu 19 Jun 2025 02:50:57 PM BST.
Repo-id            : appstream
Repo-name          : Rocky Linux 9 - AppStream
Repo-revision      : 1750303392
Repo-updated       : Thu 19 Jun 2025 04:23:12 AM BST
Repo-pkgs          : 6,247
Repo-available-pkgs: 5,911
Repo-size          : 9.4 G
Repo-mirrors       : https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=AppStream-9
Repo-baseurl       : https://rockylinux.mirrorservice.org/pub/rocky/9.6/AppStream/x86_64/os/ (52 more)
Repo-expire        : 21,600 second(s) (last: Thu 19 Jun 2025 02:50:53 PM BST)
Repo-filename      : /etc/yum.repos.d/rocky.repo

Repo-id            : baseos
Repo-name          : Rocky Linux 9 - BaseOS
Repo-revision      : 1749743563
Repo-updated       : Thu 12 Jun 2025 04:52:43 PM BST
Repo-pkgs          : 1,171
Repo-available-pkgs: 1,171
Repo-size          : 1.4 G
Repo-mirrors       : https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=BaseOS-9
Repo-baseurl       : https://rocky-linux-europe-west2.production.gcp.mirrors.ctrliq.cloud/pub/rocky//9.6/BaseOS/x86_64/os/
                   : (52 more)
Repo-expire        : 21,600 second(s) (last: Thu 19 Jun 2025 02:50:52 PM BST)
Repo-filename      : /etc/yum.repos.d/rocky.repo

Repo-id            : crb
Repo-name          : Rocky Linux 9 - CRB
Repo-revision      : 1750303425
Repo-updated       : Thu 19 Jun 2025 04:23:45 AM BST
Repo-pkgs          : 2,033
Repo-available-pkgs: 2,030
Repo-size          : 9.2 G
Repo-mirrors       : https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=CRB-9
Repo-baseurl       : https://rockylinux.mirrorservice.org/pub/rocky/9.6/CRB/x86_64/os/ (52 more)
Repo-expire        : 21,600 second(s) (last: Thu 19 Jun 2025 02:50:56 PM BST)
Repo-filename      : /etc/yum.repos.d/rocky.repo

Repo-id            : cuda-rhel9-x86_64
Repo-name          : cuda-rhel9-x86_64
Repo-revision      : 1750187541
Repo-updated       : Tue 17 Jun 2025 08:13:21 PM BST
Repo-pkgs          : 5,192
Repo-available-pkgs: 3,531
Repo-size          : 315 G
Repo-baseurl       : https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:45 PM BST)
Repo-filename      : /etc/yum.repos.d/cuda-rhel9.repo

Repo-id            : cusparselt-local-rhel9-0.7.1
Repo-name          : cusparselt-local-rhel9-0.7.1
Repo-revision      : 1739646364
Repo-updated       : Sat 15 Feb 2025 07:06:04 PM GMT
Repo-pkgs          : 2
Repo-available-pkgs: 2
Repo-size          : 569 M
Repo-baseurl       : file:///var/cusparselt-local-repo-rhel9-0.7.1
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:45 PM BST)
Repo-filename      : /etc/yum.repos.d/cusparselt-local-rhel9-0.7.1.repo

Repo-id            : docker-ce-stable
Repo-name          : Docker CE Stable - x86_64
Repo-revision      : 1744973194
Repo-updated       : Fri 18 Apr 2025 11:46:34 AM BST
Repo-pkgs          : 148
Repo-available-pkgs: 148
Repo-size          : 2.2 G
Repo-baseurl       : https://download.docker.com/linux/rhel/9/x86_64/stable
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:45 PM BST)
Repo-filename      : /etc/yum.repos.d/docker-ce.repo

Repo-id            : elrepo
Repo-name          : ELRepo.org Community Enterprise Linux Repository - el9
Repo-revision      : 1750105502
Repo-updated       : Mon 16 Jun 2025 09:25:02 PM BST
Repo-pkgs          : 423
Repo-available-pkgs: 423
Repo-size          : 1.4 G
Repo-mirrors       : http://mirrors.elrepo.org/mirrors-elrepo.el9
Repo-baseurl       : http://elrepo.org/linux/elrepo/el9/x86_64/,
                   : http://mirrors.coreix.net/elrepo/elrepo/el9/x86_64/,
                   : http://mirror.rackspace.com/elrepo/elrepo/el9/x86_64/,
                   : http://linux-mirrors.fnal.gov/linux/elrepo/elrepo/el9/x86_64/
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:46 PM BST)
Repo-filename      : /etc/yum.repos.d/elrepo.repo

Repo-id            : elrepo-testing
Repo-name          : ELRepo.org Community Enterprise Linux Testing Repository - el9
Repo-revision      : 1749216301
Repo-updated       : Fri 06 Jun 2025 02:25:01 PM BST
Repo-pkgs          : 14
Repo-available-pkgs: 14
Repo-size          : 819 M
Repo-mirrors       : http://mirrors.elrepo.org/mirrors-elrepo-testing.el9
Repo-baseurl       : http://elrepo.org/linux/testing/el9/x86_64/,
                   : http://mirrors.coreix.net/elrepo/testing/el9/x86_64/,
                   : http://mirror.rackspace.com/elrepo/testing/el9/x86_64/,
                   : http://linux-mirrors.fnal.gov/linux/elrepo/testing/el9/x86_64/
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:46 PM BST)
Repo-filename      : /etc/yum.repos.d/elrepo.repo

Repo-id            : epel
Repo-name          : Extra Packages for Enterprise Linux 9 - x86_64
Repo-revision      : 1750293416
Repo-updated       : Thu 19 Jun 2025 01:37:48 AM BST
Repo-pkgs          : 24,083
Repo-available-pkgs: 24,083
Repo-size          : 20 G
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=epel-9&arch=x86_64&infra=$infra&content=pub/rocky
  Updated          : Thu 19 Jun 2025 02:50:46 PM BST
Repo-baseurl       : https://mirrors.ukfast.co.uk/sites/dl.fedoraproject.org/pub/epel/9/Everything/x86_64/ (218
                   : more)
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:46 PM BST)
Repo-filename      : /etc/yum.repos.d/epel.repo

Repo-id            : epel-cisco-openh264
Repo-name          : Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
Repo-revision      : 1684772361
Repo-updated       : Mon 22 May 2023 05:19:21 PM BST
Repo-pkgs          : 4
Repo-available-pkgs: 4
Repo-size          : 904 k
Repo-metalink      : https://mirrors.fedoraproject.org/metalink?repo=epel-cisco-openh264-9&arch=x86_64
  Updated          : Thu 19 Jun 2025 02:50:51 PM BST
Repo-baseurl       : https://codecs.fedoraproject.org/openh264/epel/9/x86_64/os/ (0 more)
Repo-expire        : 1,209,600 second(s) (last: Thu 19 Jun 2025 02:50:51 PM BST)
Repo-filename      : /etc/yum.repos.d/epel-cisco-openh264.repo

Repo-id            : extras
Repo-name          : Rocky Linux 9 - Extras
Repo-revision      : 1748468582
Repo-updated       : Wed 28 May 2025 10:43:02 PM BST
Repo-pkgs          : 55
Repo-available-pkgs: 55
Repo-size          : 3.2 M
Repo-mirrors       : https://mirrors.rockylinux.org/mirrorlist?arch=x86_64&repo=extras-9
Repo-baseurl       : https://rockylinux.mirrorservice.org/pub/rocky/9.6/extras/x86_64/os/ (52 more)
Repo-expire        : 21,600 second(s) (last: Thu 19 Jun 2025 02:50:57 PM BST)
Repo-filename      : /etc/yum.repos.d/rocky-extras.repo

Repo-id            : google-chrome
Repo-name          : google-chrome
Repo-revision      : 1750321356
Repo-updated       : Thu 19 Jun 2025 09:22:36 AM BST
Repo-pkgs          : 4
Repo-available-pkgs: 4
Repo-size          : 463 M
Repo-baseurl       : https://dl.google.com/linux/chrome/rpm/stable/x86_64
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:51 PM BST)
Repo-filename      : /etc/yum.repos.d/google-chrome.repo

Repo-id            : nvidia-container-toolkit
Repo-name          : nvidia-container-toolkit
Repo-revision      : 1.0
Repo-updated       : Fri 30 May 2025 04:26:02 PM BST
Repo-pkgs          : 155
Repo-available-pkgs: 155
Repo-size          : 146 M
Repo-baseurl       : https://nvidia.github.io/libnvidia-container/stable/rpm/x86_64
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:52 PM BST)
Repo-filename      : /etc/yum.repos.d/nvidia-container-toolkit.repo

Repo-id            : rpmfusion-free-updates
Repo-name          : RPM Fusion for EL 9 - Free - Updates
Repo-revision      : 1750282705
Repo-tags          : binary-x86_64
Repo-updated       : Wed 18 Jun 2025 10:38:27 PM BST
Repo-pkgs          : 130
Repo-available-pkgs: 130
Repo-size          : 242 M
Repo-metalink      : http://mirrors.rpmfusion.org/metalink?repo=free-el-updates-released-9&arch=x86_64
  Updated          : Thu 19 Jun 2025 02:50:57 PM BST
Repo-baseurl       : http://www.mirrorservice.org/sites/download1.rpmfusion.org/free/el/updates/9/x86_64/ (46
                   : more)
Repo-expire        : 172,800 second(s) (last: Thu 19 Jun 2025 02:50:57 PM BST)
Repo-filename      : /etc/yum.repos.d/rpmfusion-free-updates.repo
Total packages: 39,661
[j@jscomp ~]$ sudo dnf install kernel-5.14.0-570.22.1.el9_6
Last metadata expiration check: 0:54:23 ago on Thu 19 Jun 2025 02:50:57 PM BST.
No match for argument: kernel-5.14.0-570.22.1.el9_6
Error: Unable to find a match: kernel-5.14.0-570.22.1.el9_6

I see what’s happening. We released updates at 07:00 GMT and not all mirrors have synced yet. And from what I can see, the mirrors you’re connecting are not completely in sync… For example your appstream mirror is correct but your baseos repo isn’t.

I would try to dnf clean all and dnf update again and see if you can catch mirrors that have synced. Alternatively, you can change /etc/yum.repos.d/rocky.repo under [baseos], [appstream], and [crb] to use the baseurl instead of mirrorlist. Example:

[baseos]
name=Rocky Linux $releasever - BaseOS
#mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever$rltype
baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
countme=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9

Hi thank you a lot for your help, I got the kernel 22 now. and when I run sudo dnf repolist -v again I can see they are updated now. Very appreciated ! Hope you have a good weekend :slight_smile: