As you may already know, the change to Linux firmware packaging is no longer exclusive to Resolute; it is available for 24.04, too.
$ ( source /etc/os-release ; echo $PRETTY_NAME )
Ubuntu 24.04.4 LTS
$ dpkg -l | grep linux-firmware | wc -l
19
The main purpose of this split is to improve the update process and remove the need to re-download a single, huge package repeatedly. While theoretically the split also allows for the removal of unused firmware blobs, this is not supported yet. There are no appropriate tools yet to help users keep the necessary packages. Please bear with us as we continue improving the firmware delivery mechanism. Please do not try to remove “unused” packages unless you are ready to deal with consequences.
Tips and tricks for explorers
We understand that some of you may want to experiment with an unsupported configuration by removing not needed Linux firmware packages. We would like to stress this one more time: Linux firmware package removal is not supported yet and your system may become unbootable. Of course, some of you will experiment anyway, and we would love to hear your feedback. So here are a few helpful tips that may prevent you from “bricking” your computer.
Do not follow guides for any other operating systems; they are not applicable to Ubuntu.
Even though it exists in the repositories, do NOT try using isenkram. It has no information about Ubuntu Linux firmware packages and it may break your system or create a FrankenUbuntu.
If you dare to go further, please make sure all Linux firmware packages are downloaded locally to the archives cache before experimenting:
$ ls -lh /var/cache/apt/archives/linux-firmware*.deb
If any of these are missing, fetch them again using sudo apt install --download-only PACKAGE-NAME before doing anything else. That will let you do a simple sudo apt install PACKAGE-NAME offline, if necessary.
Do not remove linux-firmware-misc package.
apt-file helps a lot. Install it with sudo apt install apt-file and make sure to refresh its database: sudo apt-file update.
Also, do not forget to rebuild the initramfs after removing the blobs; this will help you detect failures earlier. Once your system is rebooted, always check dmesg output for firmware: failed to load:
$ sudo dmesg | grep 'firmware: failed to load'
Here be dragons: guesstimating the unused blobs
By default, the system has the linux-firmware meta package installed, which prevents the removal of the component packages. In order to be able to remove anything, you need to install linux-firmware-minimal:
$ sudo apt install linux-firmware-minimal
With linux-firmware-minimal installed, you can remove individual components without breaking dependencies.
To be safe, before removing any packages, prepare a list of the files your machine is currently using. Obviously, it is not safe to remove any of those. The approach is simple: query the loaded modules; each one provides a list of firmware files it may load at runtime and map those to package names. Let’s start with the list of firmware blobs:
$ function fwf() { for mod in $(lsmod | awk 'NR>1 { print $1 }'); do modinfo "$mod" | awk '/^firmware:/ {print $2}'; done | sort -u; }
$ fwf
Once you know the firmware blob filenames, use apt-file to find the corresponding package name. Do not forget to run sudo apt-file update to have an up-to-date mapping of filenames and packages. The following snippet produces the list of firmware packages that you must retain to keep currently connected peripherals running (it takes a while to look up every single file, so please be patient):
$ function fwf2deb { apt-file find "$(basename "$1")" | awk -F: '{ print $1 }'; }
$ fwf | while read file; do fwf2deb "$file"; done | sort -u
Now you have the list of packages you should always keep installed. As it relies on modinfo metadata, it may not be 100% accurate. Another way to map firmware packages to kernel modules is to check the “Description” field:
$ apt-cache --no-all-versions show linux-firmware-qualcomm-graphics | sed -n '/^Description/,/^[A-Z]/ { /^Description/ { p; d; }; /^[A-Z]/q; p; }'
Description-en: Firmware for Qualcomm graphics and video processors
This package provides firmware used by Linux kernel drivers
adreno, iris, and venus.
Description-md5: a22ae4f27c95f83524ccbcb499f8adeb
As we can see linux-firmware-qualcomm-graphics provides firmware blobs for kernel modules adreno, iris, and venus. If you have those loaded, you need to keep this package. Automating such checks is slightly out of scope for this post, though. The list in the description is hand curated, so it may be slightly more accurate than modinfo meta data. Anyway, you should always check dmesg output for firmware: failed to load, this is the best and most accurate signal of missing firmware blob.
However, it may not be a good idea to purge everything else right now. Carefully review the packages you think you may not need and remember to always keep linux-firmware-misc. Looking at the remaining packages, there may be some obvious candidates. For example, if you have an integrated Intel video card, -amd-graphics, -nvidia-graphics, and -qualcomm-graphics may not be used -- if you have no plans to connect an external GPU, of course. The same logic can be applied to the -marvell-prestera, -marvell-wireless, -mellanox-spectrum, -netronome, and -qlogic components. You likely know whether or not you have that hardware. When in doubt, check the lspci and lsusb output for the “Vendor” information.
The usual disclaimer: if you ever add new hardware, remember to make sure you have the necessary firmware packages installed. It is now up to you to keep them in sync with hardware changes.
To test the changes, make sure initramfs is up to date (update-initramfs -u) and reboot. Check dmesg output for firmware: failed to load and use apt-file search BASENAME to see the package name if any firmware files are missing.
Please let us know about your experience; we would love to hear your opinion.