Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

RPi4 Buster Kernel Mismatch Error

Fri Aug 16, 2019 3:07 pm

I'm getting a repeated "Pending kernel upgrade!" message during updates that is not resolved by rebooting. The output of needrestart is as follows:

Code: Select all

pwt@raspberrypi-4:~ $ needrestart -k
Scanning linux images...                                                                                                         

Pending kernel upgrade!

Running kernel version:
  4.19.58-v7l+

Diagnostics:
  The currently running kernel version is not the expected kernel version 4.19.58-v7+.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting. [Return]
I'm running a fully updated Raspbian Buster on a 4GB RPi 4. Any ideas?

Thanks!

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: RPi4 Buster Kernel Mismatch Error

Mon Aug 19, 2019 9:37 am

Whatever is giving you that message, it's not installed by default. I don't know where it's getting its information from, but it probably expects a standard debian kernel setup, which is not something we use.

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Thu Aug 29, 2019 5:50 pm

Thanks for the response. FWIW, this was a standard Raspbian Desktop install, downloaded from the standard place. The problem emerged at some point after a normal update.

TaKeN
Posts: 2
Joined: Thu Dec 22, 2016 10:02 am

Re: RPi4 Buster Kernel Mismatch Error

Thu Oct 10, 2019 3:53 pm

Do You find how to repair this problem?
I got exacly same problem...

Code: Select all

root@radvd:~# needrestart -v
[main] eval /etc/needrestart/needrestart.conf
[main] needrestart v3.4
[main] running in root mode
[Core] Using UI 'NeedRestart::UI::stdio'...
[main] systemd detected
[Core] #619 is a NeedRestart::Interp::Perl
[Perl] #619: source=/usr/sbin/smokeping
[Core] #620 is a NeedRestart::Interp::Perl
[Perl] #620: could not get a source file, skipping
[Core] #621 is a NeedRestart::Interp::Perl
[Perl] #621: could not get a source file, skipping
Failed to load NeedRestart::uCode::Intel: [uCode/Intel] Not running on x86!
[ucode] no supported processor microcode detection
[Kernel] Linux: kernel release 4.19.75-v7l+, kernel version #1270 SMP Tue Sep 24 18:51:41 BST 2019
Failed to load NeedRestart::Kernel::kFreeBSD: [Kernel/kFreeBSD] Not running on GNU/kFreeBSD!
+ mktemp
+ tmp=/tmp/tmp.4vntaSDzFI
+ trap rm -f /tmp/tmp.4vntaSDzFI 0
+ get_version /boot/kernel8.img
+ strings /boot/kernel8.img
+ grep -m 1 ^Linux version
+ exit 0
+ rm -f /tmp/tmp.4vntaSDzFI
[Kernel/Linux] /boot/kernel8.img => Linux version 4.19.75-v8+ (dom@buildbot) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)) #1270 SMP PREEMPT Tue Sep 24 18:59:17 BST 2019 [4.19.75-v8+]
+ mktemp
+ tmp=/tmp/tmp.1vZHfI9XU2
+ trap rm -f /tmp/tmp.1vZHfI9XU2 0
+ get_version /boot/kernel7l.img
+ strings /boot/kernel7l.img
+ grep -m 1 ^Linux version
+ which gunzip
+ try_decompress \037\213\010 xy gunzip
+ tr \037\213\010\nxy \nxy=+
grep -abo ^xy
+ pos=18549
+ tail -c+18549 /boot/kernel7l.img
+ gunzip
+ get_version /tmp/tmp.1vZHfI9XU2
+ strings /tmp/tmp.1vZHfI9XU2
+ grep -m 1 ^Linux version
+ exit 0
+ rm -f /tmp/tmp.1vZHfI9XU2
[Kernel/Linux] /boot/kernel7l.img => Linux version 4.19.75-v7l+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1270 SMP Tue Sep 24 18:51:41 BST 2019 [4.19.75-v7l+]*
+ mktemp
+ tmp=/tmp/tmp.wL2pNsLGSb
+ trap rm -f /tmp/tmp.wL2pNsLGSb 0
+ get_version /boot/kernel7.img
+ strings+ grep -m 1 ^Linux version
 /boot/kernel7.img
+ which gunzip
+ try_decompress \037\213\010 xy gunzip
+ tr \037\213\010\nxy \nxy=
+ grep -abo ^xy
+ pos=18549
+ tail -c+18549 /boot/kernel7.img
+ gunzip
+ get_version /tmp/tmp.wL2pNsLGSb
+ strings /tmp/tmp.wL2pNsLGSb
+ grep -m 1 ^Linux version
+ exit 0
+ rm -f /tmp/tmp.wL2pNsLGSb
[Kernel/Linux] /boot/kernel7.img => Linux version 4.19.75-v7+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1270 SMP Tue Sep 24 18:45:11 BST 2019 [4.19.75-v7+]
+ mktemp
+ tmp=/tmp/tmp.S9T6ysssOP
+ trap rm -f /tmp/tmp.S9T6ysssOP 0
+ get_version /boot/kernel.img
+ strings+ grep -m 1 ^Linux version
 /boot/kernel.img
+ which gunzip
+ try_decompress \037\213\010 xy gunzip
+ tr \037\213\010\nxy \nxy=
+ grep -abo ^xy
+ pos=18093
+ tail -c+18093 /boot/kernel.img
+ gunzip
+ get_version /tmp/tmp.S9T6ysssOP
+ + grep -m 1 ^Linux version
strings /tmp/tmp.S9T6ysssOP
+ exit 0
+ rm -f /tmp/tmp.S9T6ysssOP
[Kernel/Linux] /boot/kernel.img => Linux version 4.19.75+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1270 Tue Sep 24 18:38:54 BST 2019 [4.19.75+]
[Kernel/Linux] Expected linux version: 4.19.75-v8+

Pending kernel upgrade!

Running kernel version:
  4.19.75-v7l+

Diagnostics:
  The currently running kernel version is not the expected kernel version 4.19.75-v8+.

Restarting the system to load the new kernel will not be handled automatically, so you should consider rebooting. [Return]


Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.
root@radvd:~#

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Thu Oct 10, 2019 4:27 pm

Do You find how to repair this problem?
Nope, sorry -- it's still happening on every update. Not causing any problems, just irritating :)

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Thu Oct 10, 2019 7:33 pm

OK, I figured out how to fix this. For my Pi 4, I added the following line in /boot/config.txt:

Code: Select all

kernel=kernel8.img
This loads the kernel that needrestart is expecting.

boomam
Posts: 2
Joined: Fri Oct 11, 2019 8:20 pm

Re: RPi4 Buster Kernel Mismatch Error

Fri Oct 11, 2019 8:23 pm

I have had this exact issue too.
Standard setup from the latest image + apt upgrade.
Only changes other than that is the installation of docker, and the creation of some folders within the home folder.

The solution above of specifying the kernel in config.txt fixed it for me too.
One thing to also note, if i ran "vcgencmd version" before, after the commit reference, it would should be 'tainted' as a status.
Whereas post change to the v8 kernel, it now shows 'clean'.

boomam
Posts: 2
Joined: Fri Oct 11, 2019 8:20 pm

Re: RPi4 Buster Kernel Mismatch Error

Fri Oct 11, 2019 8:33 pm

I have had this exact issue too.
Standard setup from the latest image + apt upgrade.
Only changes other than that is the installation of docker, and the creation of some folders within the home folder.

The solution above of specifying the kernel in config.txt fixed it for me too.
One thing to also note, if i ran "vcgencmd version" before, after the commit reference, it would should be 'tainted' as a status.
Whereas post change to the v8 kernel, it now shows 'clean'.

sonata_facile
Posts: 1
Joined: Sun Oct 27, 2019 9:30 pm

Re: RPi4 Buster Kernel Mismatch Error

Sun Oct 27, 2019 9:34 pm

I also get this message after every update: "The currently running kernel version is 4.19.75-v7+ which is not the expected kernel version 4.19.75-v8+" I run Raspbian on 2 Raspberry Pi 3+.

mrshark
Posts: 5
Joined: Thu Oct 31, 2019 11:03 am

Re: RPi4 Buster Kernel Mismatch Error

Thu Oct 31, 2019 11:07 am

same here, i get (on rpi4 4gb fully updated):
The currently running kernel version is 4.19.80-v7l+ which is not the expected kernel version 4.19.80-v8+.
addin "kernel=kernel8.img" to config.txt caused the board to not start, had to remove that via windows pc

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Thu Oct 31, 2019 5:05 pm

mrshark wrote:
Thu Oct 31, 2019 11:07 am
same here, i get (on rpi4 4gb fully updated):
The currently running kernel version is 4.19.80-v7l+ which is not the expected kernel version 4.19.80-v8+.
addin "kernel=kernel8.img" to config.txt caused the board to not start, had to remove that via windows pc
What's the output of uname -a on your Pi?

fbe
Posts: 642
Joined: Thu Aug 17, 2017 9:08 pm

Re: RPi4 Buster Kernel Mismatch Error

Thu Oct 31, 2019 6:17 pm

The place to wait for help is here:https://github.com/liske/needrestart/issues/146 or here https://github.com/liske/needrestart/issues/155.
needrestart needs to be fixed. v8 is not a kernel version but an ARM architecture version.

My fully upgraded RPi 4B currently runs with 4.19.75-v7l+ #1270. If I add

Code: Select all

kernel=kernel8.img
to config.txt it runs with 4.19.75-v8+ #1270. Don't know, how experimental is 4.19.80.

mrshark
Posts: 5
Joined: Thu Oct 31, 2019 11:03 am

Re: RPi4 Buster Kernel Mismatch Error

Thu Oct 31, 2019 7:52 pm

Psychlist wrote:
Thu Oct 31, 2019 5:05 pm
mrshark wrote:
Thu Oct 31, 2019 11:07 am
same here, i get (on rpi4 4gb fully updated):
The currently running kernel version is 4.19.80-v7l+ which is not the expected kernel version 4.19.80-v8+.
addin "kernel=kernel8.img" to config.txt caused the board to not start, had to remove that via windows pc
What's the output of uname -a on your Pi?

Code: Select all

pi@raspberrypi:~ $ sudo apt update
Scaricamento di:1 http://archive.raspberrypi.org/debian buster InRelease [25,2 kB]
Scaricamento di:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15,0 kB]
Scaricamento di:3 http://archive.raspberrypi.org/debian buster/main armhf Packages [259 kB]
Trovato:4 https://download.docker.com/linux/raspbian buster InRelease
Recuperati 299 kB in 6s (52,2 kB/s)
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
Tutti i pacchetti sono aggiornati.

pi@raspberrypi:~ $ sudo apt upgrade
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
Calcolo dell'aggiornamento... Fatto
0 aggiornati, 0 installati, 0 da rimuovere e 0 non aggiornati.

pi@raspberrypi:~ $ sudo apt dist-upgrade
Lettura elenco dei pacchetti... Fatto
Generazione albero delle dipendenze
Lettura informazioni sullo stato... Fatto
Calcolo dell'aggiornamento... Fatto
0 aggiornati, 0 installati, 0 da rimuovere e 0 non aggiornati.

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.80-v7l+ #1275 SMP Mon Oct 28 18:37:34 GMT 2019 armv7l GNU/Linux

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Fri Nov 01, 2019 9:35 am

mrshark wrote:
Thu Oct 31, 2019 7:52 pm

Code: Select all

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.80-v7l+ #1275 SMP Mon Oct 28 18:37:34 GMT 2019 armv7l GNU/Linux
So, you're currently running a 32-bit kernel, which is what I'd expect given the omission of the 'kernel' directive in boot.txt. I wonder why it didn't work in your case. I think the problem is that needrestart expects a 64-bit kernel ('aarch64' instead of 'armv7l').

Let's check that kernel8.img is present: what's the output of ls -l /boot/*.img ?

mrshark
Posts: 5
Joined: Thu Oct 31, 2019 11:03 am

Re: RPi4 Buster Kernel Mismatch Error

Sun Nov 03, 2019 9:10 am

Psychlist wrote:
Fri Nov 01, 2019 9:35 am
mrshark wrote:
Thu Oct 31, 2019 7:52 pm

Code: Select all

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.80-v7l+ #1275 SMP Mon Oct 28 18:37:34 GMT 2019 armv7l GNU/Linux
So, you're currently running a 32-bit kernel, which is what I'd expect given the omission of the 'kernel' directive in boot.txt. I wonder why it didn't work in your case. I think the problem is that needrestart expects a 64-bit kernel ('aarch64' instead of 'armv7l').

Let's check that kernel8.img is present: what's the output of ls -l /boot/*.img ?

Code: Select all

pi@raspberrypi:~ $ ls -l /boot/kernel*
-rwxr-xr-x 1 root root  5312792 ott 31 11:19 /boot/kernel7.img
-rwxr-xr-x 1 root root  5629336 ott 31 11:19 /boot/kernel7l.img
-rwxr-xr-x 1 root root 13165056 ott 31 11:19 /boot/kernel8.img
-rwxr-xr-x 1 root root  5029608 ott 31 11:19 /boot/kernel.img
i'm using a clean desktop (basic, not the full one) raspbian buster, on top of which i've put docker, that's it

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Mon Nov 04, 2019 10:23 am

For comparison, this is what I see in my /boot directory:

Code: Select all

ls -l /boot/kernel*
-rwxr-xr-x 1 root root  5310624 Oct 12 07:56 /boot/kernel7.img
-rwxr-xr-x 1 root root  5628040 Oct 12 07:56 /boot/kernel7l.img
-rwxr-xr-x 1 root root 13230592 Oct 12 07:56 /boot/kernel8.img
-rwxr-xr-x 1 root root  5029176 Oct 12 07:56 /boot/kernel.img
I'm on a fully updated system, but for some reason your kernel images are more recent than mine. FWIW, this is what I have in /boot/config.txt:

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# pwt 2019-10-10
kernel=kernel8.img

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
gpu_mem=64
The only thing I added was the 'kernel' line.

mrshark
Posts: 5
Joined: Thu Oct 31, 2019 11:03 am

Re: RPi4 Buster Kernel Mismatch Error

Mon Nov 04, 2019 10:30 am

I did a RPi-update too, to update firmware as my pi was brand new, could be that?

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Mon Nov 04, 2019 10:43 am

mrshark wrote:
Mon Nov 04, 2019 10:30 am
I did a RPi-update too, to update firmware as my pi was brand new, could be that?
I wasn't even aware of the existence of rpi-update, but there seem to be plenty of warnings against using it unless you have a specific reason. It pulls in the bleeding edge of the kernel as well as the firmware. So, it's possible that's the problem. I guess you'll need someone with rpi-update expertise to help. (Personally, I'd want to figure out how to get back onto a stable kernel and firmware.)

User avatar
DougieLawson
Posts: 39136
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: RPi4 Buster Kernel Mismatch Error

Mon Nov 04, 2019 10:50 am

To get back to stable kernel re-install the raspberrypi-bootloader & raspberrypi-kernel packages.

Don't run rpi-update unless you're instructed to do so.
rpi-update/NOTICE.md wrote:

Code: Select all

#############################################################
WARNING: 'rpi-update' updates to pre-releases of the linux 
kernel tree and Videocore firmware.

'rpi-update' should only be used if there is a specific 
reason to do so - for example, a request by a Raspberry Pi 
engineer.

DO NOT use 'rpi-update' as part of a regular update process.

##############################################################
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

mrshark
Posts: 5
Joined: Thu Oct 31, 2019 11:03 am

Re: RPi4 Buster Kernel Mismatch Error

Mon Nov 04, 2019 10:51 am

my rpi4 is pretty stable, no issues, just this warning... and updating firmware was adviced in early september to reduce the usb power consumption and the relative heat

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Mon Nov 04, 2019 11:05 am

mrshark wrote:
Mon Nov 04, 2019 10:51 am
my rpi4 is pretty stable, no issues, just this warning
Except you can't seem to boot the 64 bit kernel, which might be a firmware issue, or an issue with the kernel.
... updating firmware was adviced in early september to reduce the usb power consumption and the relative heat
The normal (apt) update process takes care of providing firmware updates once they're stable. I don't think rpi-update is necessary under normal circumstances.

jmrnilsson
Posts: 3
Joined: Sat Feb 08, 2014 3:34 pm

Re: RPi4 Buster Kernel Mismatch Error

Sun Nov 24, 2019 7:59 am

I get this too.

Started to happen after a apt full-upgrade.

Code: Select all

  │ The currently running kernel version is 4.19.75-v7l+ which is not the expected kernel    │ 
  │ version 4.19.75-v8+.                                                                     │ 
  │                       

planesweep
Posts: 1
Joined: Sun Dec 15, 2019 5:34 am

Re: RPi4 Buster Kernel Mismatch Error

Sun Dec 15, 2019 5:35 am

Is there any fix?

Psychlist
Posts: 12
Joined: Wed Nov 21, 2018 11:41 am

Re: RPi4 Buster Kernel Mismatch Error

Fri Dec 20, 2019 11:29 am

planesweep wrote:
Sun Dec 15, 2019 5:35 am
Is there any fix?
See my post above.

someSven
Posts: 25
Joined: Tue Nov 27, 2018 11:17 am

Re: RPi4 Buster Kernel Mismatch Error

Mon Jan 06, 2020 12:07 am

I have the same problem and I find it irritating. It's just something that makes users worry for maybe no reason. I hope it can be fixed. It might be coming from "needrestart". But I don't get the message when I just run needrestart, only after installing something. Edit: BTW, I have the problem with Raspi3. In the past I used rpi--upgrade all the time before they put the warning in, I think it was because of that.
Scanning processes...
Scanning linux images...

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

Return to “Troubleshooting”