LINUX-UPDATE-SYMLINKS(1)
π LINUX-UPDATE-SYMLINKS(1) π
General Commands Manual πΈ
β¨ NAME β¨
okay bestie, this one is linux-update-symlinks, and its whole job is maintaining symlinks to the default kernel and initramfs π§
π SYNOPSIS π
linux-update-symlinks {install|upgrade|remove} KERNEL-VER IMAGE-PATH
π DESCRIPTION π
okay so linux-update-symlinks is made to be called from the postinst and postrm maintainer scripts of Linux kernel packages π₯ the postinst script has to pass either install or upgrade as the first argument, depending on whether it's a fresh install or an upgrade.
The KERNEL-VER argument needs to be the kernel version string as shown by uname -r and used in filenames. It's not the package version, so don't mix them up, periodt π
The IMAGE-PATH argument must be the absolute filename of the kernel image. no relative paths, no cap π
By default, this command maintains the symlinks in the root directory. you can change that with settings in /etc/kernel-img.conf π¦
image_destβ picks the directory where the symlinks get maintainedlink_in_bootβ if set to a true value, the directory is/bootβ¨do_symlinksβ if set to a false value, symlink maintenance is turned off π
The symlinks for the primary default kernel are named vmlinuz or vmlinux, depending on whether the architecture normally uses compressed kernel images. If it uses an initramfs, there's also initrd.img. The secondary default gets the exact same names with the suffix .old tacked on π
If symlink maintenance is disabled, linux-update-symlinks does nothing and still exits successfully, lowkey the most chill outcome ever π«Ά Otherwise, it builds a list of kernel versions in decreasing order of priority:
- The given
KERNEL-VER, if the first argument isinstallπ - The current primary default version, if it exists and isn't already on the list β¨
- The current secondary default version, if it exists and isn't already on the list π
- All other versions whose files are installed, excluding the specified
KERNEL-VERif the first argument isremove. these go in decreasing version order π§
The top two entries on that list become the new primary and secondary default versions, and the symlinks get updated to match π If there's only one entry, it's both the primary and secondary default. If there are no entries at all, there are no default versions, so it removes the default symlinks. iykyk π
πΈ ENVIRONMENT VARIABLES πΈ
INITRDβ when the first argument isinstallorupgrade,linux-update-symlinksassumes the givenKERNEL-VERwill use an initramfs. the only exception is if this variable is set toNoπ
ποΈ FILES ποΈ
/boot/initrd.img-*β installed initramfs images π§Έ/boot/vmlinuz-*|/boot/vmlinux-*β installed kernel images π/etc/kernel-img.confβ config file that says whether and where to create symlinks β/initrd.imgβ symlink to the initramfs image for the primary default version π/initrd.img.oldβ symlink to the initramfs image for the secondary default version π/vmlinuz|/vmlinuxβ symlink to the kernel image for the primary default version π₯/vmlinuz.old|/vmlinux.oldβ symlink to the kernel image for the secondary default version π¦
π©βπ» AUTHOR π©βπ»
linux-update-symlinks and this manual page were written by Ben Hutchings as part of the Debian linux-base package. he's literally iconic π
π SEE ALSO π
kernel-img.conf(5), linux-version(1). go check those out next, you won't regret it π«Ά
bestie, that's the whole page π LINUX-UPDATE-SYMLINKS(1), last updated 5 June 2016, and you are officially kernel-symlink literate now πβ¨
π¦ where this page comes from
- debian bookworm: linux-base 4.12.1~deb12u1 Β· GPL-2.0-only
- debian trixie: linux-base 4.12.1 Β· GPL-2.0-only
- ubuntu questing: linux-base 4.14ubuntu2 Β· GPL-2.0-only
- ubuntu resolute: linux-base 4.15ubuntu5 Β· GPL-2.0-only
- ubuntu stonking: linux-base 4.17ubuntu1 Β· GPL-2.0-only
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms