Why every single system service (script) think that there is kernel 6.8, while it…
- User
Why every single system service (script) think that there is kernel 6.8, while it actually 6.12??? And, of course, it couldn't find any modules... How to fix this?
root@mint:/# dracut --force dracut[F]: Cannot find module directory /lib/modules/6.8.0-51-generic/ dracut[F]: and --no-kernel was not specified root@mint:/# ls /lib/modules/6.8.0-51-generic/ ls: cannot access '/lib/modules/6.8.0-51-generic/': No such file or directory root@mint:/# ls /lib/modules/ 6.11.3-200.fc40.x86_64 6.12.11-100.fc40.x86_64 root@mint:/#
- Assistant
It seems like your system is misconfigured regarding the kernel version, and various scripts are looking for modules in a directory that doesn't exist. The message indicates that something is still referencing an older kernel version (
6.8.0-51-generic) that's not currently installed on your system.Here are some steps you can take to troubleshoot and fix this issue:
-
Update GRUB Configuration:
- Ensure the
grubconfiguration is pointing to the correct kernel version. Update GRUB by running:sudo update-grub - Check your GRUB configuration file (usually located at
/boot/grub/grub.cfg) to ensure it lists the correct kernel version.
- Ensure the
-
Check Installed Kernels:
- List the installed kernels:
dpkg --list | grep linux-image - If you see some old kernel versions listed (like
6.8.0-51-generic), you may consider removing them to avoid confusion. - You can remove the old kernel using:
sudo apt remove linux-image-6.8.0-51-generic - Confirm if the kernel is listed correctly again by checking the output of the above command.
- List the installed kernels:
-
Rebuild Initramfs:
- If the kernel version is correctly set and you still encounter problems, you may need to rebuild the initramfs for the current kernel:
sudo update-initramfs -u -k all
- If the kernel version is correctly set and you still encounter problems, you may need to rebuild the initramfs for the current kernel:
-
Check System Configuration:
- Verify whether configuration files (like
/etc/lsb-releaseor/etc/os-release) were modified and could be causing issues with the version number.
- Verify whether configuration files (like
-
Regenerate Dracut Config (If using Dracut):
- If you are using
dracut, you may need to regenerate a new initramfs:dracut --force
- If you are using
-
Review
/lib/modulesDirectory:- Make sure that your
/lib/modulesdirectory is populated with the correct versions. If the correct modules for your current kernel (6.12.11-100.fc40.x86_64) are not present, you may have to reinstall the kernels.
- Make sure that your
-
Reinstall the Current Kernel:
- In case the kernel modules are not present, reinstalling the current kernel might help. For example, for a Debian or Ubuntu-based system:
sudo apt install --reinstall linux-image-6.12.11-100.fc40.x86_64
- In case the kernel modules are not present, reinstalling the current kernel might help. For example, for a Debian or Ubuntu-based system:
-
Reboot:
- Finally, reboot your system, and check if the issue is resolved and the correct kernel modules are being used:
uname -r
- Finally, reboot your system, and check if the issue is resolved and the correct kernel modules are being used:
If, after following these steps, the problem persists, additional troubleshooting or investigation into logs might be necessary to find other underlying causes.
-
- User
I am using fedora, not debian
- Assistant
Thank you for the clarification. Here’s how to troubleshoot and fix the kernel module issue on Fedora:
Steps to Resolve Kernel Module Issues on Fedora:
-
Check Installed Kernels:
- First, check which kernels are currently installed:
rpm -q kernel
- First, check which kernels are currently installed:
-
Verify the Current Running Kernel:
- Use the following command to see the kernel you are currently running:
uname -r
- Use the following command to see the kernel you are currently running:
-
Remove Old Kernels:
- If you see older kernels (like
6.8.0-51-generic), you may want to clean them up. You can remove older kernels using the following command:sudo dnf remove kernel-<old_version> - Replace
<old_version>with the version you want to remove (e.g.,kernel-6.8.0-51-generic).
- If you see older kernels (like
-
Regenerate Initramfs:
- You might need to regenerate the initramfs for the current kernel:
sudo dracut --force
- You might need to regenerate the initramfs for the current kernel:
-
Install Kernel Development Packages:
- Ensure that you have the necessary kernel development packages installed for the currently running kernel:
sudo dnf install kernel-devel kernel-headers
- Ensure that you have the necessary kernel development packages installed for the currently running kernel:
-
Update GRUB:
- Update the bootloader to properly configure it with the existing kernels:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
- Update the bootloader to properly configure it with the existing kernels:
-
Reboot:
- After making these changes, reboot your system:
sudo reboot
- After making these changes, reboot your system:
-
Check Module Directory Again:
- After rebooting, verify whether the module directory structure is correctly set:
ls /lib/modules/ - Confirm that there is a directory matching your currently running kernel version.
- After rebooting, verify whether the module directory structure is correctly set:
-
If the Problem Persists:
- If you’re still encountering issues, you might consider reinstalling the current kernel:
sudo dnf reinstall kernel-core kernel-modules
- If you’re still encountering issues, you might consider reinstalling the current kernel:
-
Check Logs:
- Review system logs for any errors related to kernel loading or modules:
journalctl -xe
- Review system logs for any errors related to kernel loading or modules:
Following these steps should help resolve the issues related to kernel modules on Fedora. If the problem persists after trying all of the above, it might be worth checking Fedora forums or specific documentation for any related bugs or system configurations that could be affecting your setup.
-