Regenerating the initramfs images does take some time, especially on the slower Pis. Especially on the 32-bit systems which have more images to create.
If you know you are always going to use the same card on the same Pi you can delete the kernel-image packages that are not used on that system. If you check you will see a number of "linux-image-rpi-xxxx" packages installedYou will have more than that on a 32-bit system.
Look to see what kernel you are running o that Pi:My test system is a Pi 5 so it is running the -2712 kernel, although a Pi 5 can also run the -v8 kernel.
Remove the ones you're not using. In my case that would be the -v8, but there may be a -v6, -v7 and -v7l version as well.Make sure you don't include the kernel version that you are running! ie, if you are running the -v7 kernel, use linux-image*-rpi-{v6,v7l,v8,2712} for the apt command.
After that you should only have one type of initramfs to rebuild during upgrades which should make it a lot faster.
You can also get rid of any old version prior to the one you are running, but they normally get cleared out automatically.
If you know you are always going to use the same card on the same Pi you can delete the kernel-image packages that are not used on that system. If you check you will see a number of "linux-image-rpi-xxxx" packages installed
Code:
rpdom@raspberrypi:~ $ dpkg -l 'linux-image*'Desired=Unknown/Install/Remove/Purge/Hold| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)||/ Name Version Architecture Description+++-========================================-===============-============-=========================>ii linux-image-6.6.47+rpt-rpi-2712 1:6.6.47-1+rpt1 arm64 Linux 6.6 for Raspberry P>un linux-image-6.6.47+rpt-rpi-2712-unsigned <none> <none> (no description available)ii linux-image-6.6.47+rpt-rpi-v8 1:6.6.47-1+rpt1 arm64 Linux 6.6 for Raspberry P>ii linux-image-6.6.51+rpt-rpi-2712 1:6.6.51-1+rpt3 arm64 Linux 6.6 for Raspberry P>un linux-image-6.6.51+rpt-rpi-2712-unsigned <none> <none> (no description available)ii linux-image-6.6.51+rpt-rpi-v8 1:6.6.51-1+rpt3 arm64 Linux 6.6 for Raspberry P>ii linux-image-rpi-2712 1:6.6.51-1+rpt3 arm64 Linux for Raspberry Pi 27>ii linux-image-rpi-v8 1:6.6.51-1+rpt3 arm64 Linux for Raspberry Pi v8>rpdom@raspberrypi:~ $ dpkg -l 'linux-image*' | grep "^ii"ii linux-image-6.6.47+rpt-rpi-2712 1:6.6.47-1+rpt1 arm64 Linux 6.6 for Raspberry Pi 2712, Raspberry Piii linux-image-6.6.47+rpt-rpi-v8 1:6.6.47-1+rpt1 arm64 Linux 6.6 for Raspberry Pi v8, Raspberry Piii linux-image-6.6.51+rpt-rpi-2712 1:6.6.51-1+rpt3 arm64 Linux 6.6 for Raspberry Pi 2712, Raspberry Piii linux-image-6.6.51+rpt-rpi-v8 1:6.6.51-1+rpt3 arm64 Linux 6.6 for Raspberry Pi v8, Raspberry Piii linux-image-rpi-2712 1:6.6.51-1+rpt3 arm64 Linux for Raspberry Pi 2712 (meta-package)ii linux-image-rpi-v8 1:6.6.51-1+rpt3 arm64 Linux for Raspberry Pi v8 (meta-package)
Look to see what kernel you are running o that Pi:
Code:
rpdom@raspberrypi:~ $ uname -r6.6.51+rpt-rpi-2712
Remove the ones you're not using. In my case that would be the -v8, but there may be a -v6, -v7 and -v7l version as well.
Code:
rpdom@raspberrypi:~ $ sudo apt --autoremove purge linux-image-*rpi-{v6,v7,v7l,v8}Reading package lists... DoneBuilding dependency tree... DoneReading state information... DoneNote, selecting 'linux-image-6.6.47+rpt-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.1.0-rpi2-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.1.0-rpi6-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.1.0-rpi3-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.6.28+rpt-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.1.0-rpi7-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.1.0-rpi4-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.6.51+rpt-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.1.0-rpi1-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.1.0-rpi8-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.6.20+rpt-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.6.31+rpt-rpi-v6:armhf' for glob 'linux-image-*rpi-v6'Note, selecting 'linux-image-6.6.47+rpt-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.1.0-rpi2-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.1.0-rpi6-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.1.0-rpi3-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.6.28+rpt-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.1.0-rpi7-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.1.0-rpi4-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.6.51+rpt-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.1.0-rpi1-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.1.0-rpi8-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.6.20+rpt-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.6.31+rpt-rpi-v7:armhf' for glob 'linux-image-*rpi-v7'Note, selecting 'linux-image-6.6.47+rpt-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.6.51+rpt-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.6.20+rpt-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.6.31+rpt-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.1.0-rpi7-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.1.0-rpi2-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.1.0-rpi4-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.1.0-rpi6-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.1.0-rpi8-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.1.0-rpi1-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.1.0-rpi3-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.6.28+rpt-rpi-v7l:armhf' for glob 'linux-image-*rpi-v7l'Note, selecting 'linux-image-6.6.47+rpt-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.1.0-rpi2-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.1.0-rpi6-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.1.0-rpi3-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.6.28+rpt-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.1.0-rpi7-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.1.0-rpi4-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.6.51+rpt-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.1.0-rpi1-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.1.0-rpi8-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.6.20+rpt-rpi-v8' for glob 'linux-image-*rpi-v8'Note, selecting 'linux-image-6.6.31+rpt-rpi-v8' for glob 'linux-image-*rpi-v8'Package 'linux-image-6.6.20+rpt-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.6.28+rpt-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.6.31+rpt-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.6.47+rpt-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.6.51+rpt-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi1-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi2-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi3-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi4-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi6-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi7-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi8-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-rpi-v6:armhf' is not installed, so not removedPackage 'linux-image-6.6.20+rpt-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.6.28+rpt-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.6.31+rpt-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.6.47+rpt-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.6.51+rpt-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi1-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi2-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi3-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi4-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi6-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi7-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi8-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-rpi-v7:armhf' is not installed, so not removedPackage 'linux-image-6.6.20+rpt-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.6.28+rpt-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.6.31+rpt-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.6.47+rpt-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.6.51+rpt-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi1-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi2-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi3-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi4-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi6-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi7-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.1.0-rpi8-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-rpi-v7l:armhf' is not installed, so not removedPackage 'linux-image-6.6.20+rpt-rpi-v8' is not installed, so not removedPackage 'linux-image-6.6.28+rpt-rpi-v8' is not installed, so not removedPackage 'linux-image-6.6.31+rpt-rpi-v8' is not installed, so not removedPackage 'linux-image-6.1.0-rpi1-rpi-v8' is not installed, so not removedPackage 'linux-image-6.1.0-rpi2-rpi-v8' is not installed, so not removedPackage 'linux-image-6.1.0-rpi3-rpi-v8' is not installed, so not removedPackage 'linux-image-6.1.0-rpi4-rpi-v8' is not installed, so not removedPackage 'linux-image-6.1.0-rpi6-rpi-v8' is not installed, so not removedPackage 'linux-image-6.1.0-rpi7-rpi-v8' is not installed, so not removedPackage 'linux-image-6.1.0-rpi8-rpi-v8' is not installed, so not removedThe following packages will be REMOVED: linux-image-6.6.47+rpt-rpi-v8* linux-image-6.6.51+rpt-rpi-v8* linux-image-rpi-v8*0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.After this operation, 66.6 MB disk space will be freed.Do you want to continue? [Y/n]
After that you should only have one type of initramfs to rebuild during upgrades which should make it a lot faster.
You can also get rid of any old version prior to the one you are running, but they normally get cleared out automatically.
Statistics: Posted by rpdom — Tue Nov 12, 2024 12:38 pm