It is not possible to uninstall a locally built RPI kernel

Bug #2018946 reported by Andrei Kholodnyi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flash-kernel (Ubuntu)
New
Undecided
Unassigned

Bug Description

# latest Ubuntu 22.04
ubuntu@ubuntu:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"

# latest Ubuntu kernel
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.15.0-1027-raspi #29-Ubuntu SMP PREEMPT Mon Apr 3 10:12:21 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@ubuntu:~$ ls -la /boot/vmlinuz*
lrwxrwxrwx 1 root root 25 May 6 10:05 /boot/vmlinuz -> vmlinuz-5.15.0-1027-raspi
-rw------- 1 root root 10338087 Apr 3 09:39 /boot/vmlinuz-5.15.0-1027-raspi

ubuntu@ubuntu:~$ ls -la /boot/firmware/vmlinuz*
-rwxr-xr-x 1 root root 10338087 May 8 22:09 /boot/firmware/vmlinuz
-rwxr-xr-x 1 root root 10338087 May 8 22:09 /boot/firmware/vmlinuz.bak

# install locally built kernel
ubuntu@ubuntu:~$ ls *.deb
linux-headers-5.15.98-rt62-raspi_5.15.98-rt62-raspi-1_arm64.deb
linux-image-5.15.98-rt62-raspi_5.15.98-rt62-raspi-1_arm64.deb
linux-libc-dev_5.15.98-rt62-raspi-1_arm64.deb

ubuntu@ubuntu:~$ sudo dpkg -i *.deb

# Reboot the system
ubuntu@ubuntu:~$ sudo reboot

# Check kernel version, it is the local one
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.15.98-rt62-raspi #1 SMP PREEMPT_RT Sat May 6 20:53:20 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

ubuntu@ubuntu:~$ ls -la /boot/vmlinuz*
lrwxrwxrwx 1 root root 25 May 6 10:05 /boot/vmlinuz -> vmlinuz-5.15.0-1027-raspi
-rw------- 1 root root 10338087 Apr 3 09:39 /boot/vmlinuz-5.15.0-1027-raspi
-rw-r--r-- 1 root root 10403897 May 6 20:53 /boot/vmlinuz-5.15.98-rt62-raspi
lrwxrwxrwx 1 root root 25 May 8 22:19 /boot/vmlinuz.old -> vmlinuz-5.15.0-1027-raspi

ubuntu@ubuntu:~$ ls -la /boot/firmware/vmlinuz*
-rwxr-xr-x 1 root root 10403897 May 8 22:14 /boot/firmware/vmlinuz
-rwxr-xr-x 1 root root 10338087 May 8 22:09 /boot/firmware/vmlinuz.bak

# remove local kernel
ubuntu@ubuntu:~$ sudo dpkg -r linux-image-5.15.98-rt62-raspi
(Reading database ... 141758 files and directories currently installed.)
Removing linux-image-5.15.98-rt62-raspi (5.15.98-rt62-raspi-1) ...
update-initramfs: Deleting /boot/initrd.img-5.15.98-rt62-raspi
Using DTB: bcm2711-rpi-4-b.dtb
flash-kernel: Kernel 5.15.98-rt62-raspi has been removed.
flash-kernel: Flashing the remaining highest-versioned kernel (5.15.0-1027-raspi).
Ignoring old or unknown version 5.15.98-rt62-raspi (latest is 5.15.0-1027-raspi)

# check whether local kernel is removed, it is still there under /boot/firmware/vmlinuz
ubuntu@ubuntu:~$ ls -la /boot/vmlinuz*
lrwxrwxrwx 1 root root 25 May 6 10:05 /boot/vmlinuz -> vmlinuz-5.15.0-1027-raspi
-rw------- 1 root root 10338087 Apr 3 09:39 /boot/vmlinuz-5.15.0-1027-raspi
lrwxrwxrwx 1 root root 25 May 8 22:19 /boot/vmlinuz.old -> vmlinuz-5.15.0-1027-raspi
ubuntu@ubuntu:~$ ls -la /boot/firmware/vmlinuz*
-rwxr-xr-x 1 root root 10403897 May 8 22:14 /boot/firmware/vmlinuz
-rwxr-xr-x 1 root root 10338087 May 8 22:09 /boot/firmware/vmlinuz.bak

# reboot the system
ubuntu@ubuntu:~$ sudo reboot

# it is the same local kernel again
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.15.98-rt62-raspi #1 SMP PREEMPT_RT Sat May 6 20:53:20 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.