this post was submitted on 16 Aug 2025
20 points (91.7% liked)
Linux
57549 readers
821 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
would you help the noob here and explain how to do that?
Something like
dpkg -l '*linux-image*'
and then see which are installed (ii
), and then do adpkg remove <package name from above>
on some, but don't remove the one you are running now, checkuname -a
to see.Keep in mind this is all from memory, so might be wrong
Edit: now I see others replied as well with better ways
apt autoremove should do it
List all installed kernels:
dpkg -l | grep linux-image | awk '{print$2}'
Remove certain kernels:
sudo apt remove --purge linux-image-XXX
where XXX is the kernel version you wish to remove, as printed above. Repeat as needed until all unwanted kernels have been removed.
Then update grub:
sudo update-grub2
And reboot:
sudo reboot
thanks. I did all that. Is it safe to reboot? don't want to ruin the machine
I would run a final
update-initramfs -u -k all
before a rebootjust to avoid misunderstandings, I assume the final >french accent lemmy wont show< in your code is lemmy code and you forgot to type the >french accent lemmy wont show< at the beginning of the command, right? because the one without the >french accent lemmy wont show< returns
-bash: update-initramfs: command not found
incidentally, another member suggested I run
sudo dpkg-reconfigure initramfs-tools
it returns:
update-initramfs: deferring update (trigger activated) Processing triggers for initramfs-tools (0.148.3) ... update-initramfs: Generating /boot/initrd.img-6.12.41+deb13-amd64 zstd: error 70 : Write error : cannot write block : No space left on device E: mkinitramfs failure cpio 141 E: mkinitramfs failure zstd -q -9 -T0 70 update-initramfs: failed for /boot/initrd.img-6.12.41+deb13-amd64 with 1. dpkg: error processing package initramfs-tools (--configure): installed initramfs-tools package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: initramfs-tools
but this is something I don't understand. I deleted 6 old kernels already. There are only 3 left.
After checking KDE Partition Manager for /boot and /boot/efi both have free space left:
/boot size: 488 MiB
/boot used: 396.26 MiB
/boot/efi size: 512 MiB
/boot/efi used: 10.52 MiB
I've created a small helper script to help me with this:
It prints a list of the installed kernels (excl. the running one) and prints the command to uninstall the packages (it doesn't remove anything by itself).