basforge

Search titles, text and the “If it doesn’t work” cases.

    RU

    After an update, check /var/run/reboot-required

    An updated kernel and systemd only take effect after a reboot — until then the server runs the old code with its holes open. /var/run/reboot-required appears when a reboot is needed, and the .pkgs file next to it says which packages caused it.

    What it looks like

    On SSH login Ubuntu shows the line from this file itself:

    *** System restart required ***

    What needs the reboot:

    cat /var/run/reboot-required.pkgs
    # linux-image-6.8.0-87-generic
    # linux-base

    A kernel in the list — reboot: kernel fixes don’t apply without it. Only libraries (libc6, libssl3t64) — needrestart has usually restarted the services already, but processes outside services (sessions, containers) keep the old copy until they restart.

    Is the new kernel running yet:

    uname -r
    # 6.8.0-85-generic       ← running
    ls /boot/vmlinuz-* | tail -1
    # /boot/vmlinuz-6.8.0-87-generic   ← installed, waiting for a reboot

    When to reboot

    • With Automatic-Reboot "true" (unattended-upgrades) the server does it itself at 4:00.
    • Without it, at a quiet time: sudo shutdown -r 04:00; cancel with sudo shutdown -c.
    • Right away — if the list has a kernel and the news has a kernel hole with a working exploit.

    Livepatch from Ubuntu Pro (free for 5 machines) lets you skip kernel reboots: sudo pro enable livepatch. It patches critical kernel holes live but doesn’t replace planned reboots — regular kernel updates still wait for one.