Skip to content
CYBER SECURE
SYSTEM
Let’s talk security

Bridging EOL Ubuntu Releases to 24.04.5 LTS: Multi-Hop Upgraders, 54 GB Disk Reclamation, Boot Hang Fixes, and 0-Byte NVIDIA HDMI EDID Recovery

Upgrading an end-of-life non-LTS Ubuntu machine that carries active databases, CUDA toolkits, custom desktop sessions, and years of developer caches is full of subtle traps—starting with do-release-upgrade -c claiming you can jump straight to Ubuntu 24.04.5 LTS when the upgrader will actually refuse to skip intermediate releases. In Part 1 of our 5-Part Linux & Full-Stack Hardening Series, we walk through the exact commands we used to bridge three release hops safely, reclaim 54 GB of hidden upgrade debt, shave two full minutes off boot time, and recover 4K resolution when an HDMI link returns edid_bytes=0.

Architecture blueprint showing sequential Ubuntu 22.10 to 23.04 to 23.10 to 24.04.5 LTS upgrades via old-releases.ubuntu.com, 54 GB disk reclamation, systemd-networkd-wait-online boot hang removal, and NVIDIA 595 0-byte HDMI EDID override
Figure 1: Safe multi-hop LTS migration sequence, post-upgrade bloat cleanup, and hardware-agnostic 4K Xorg mode recovery.

1. Why Direct EOL Upgrades Fail—and How to Prep APT First

Ubuntu only supports direct LTS-to-LTS jumps (such as 22.04 LTS → 24.04 LTS). If a host was left on an interim nine-month release like 22.10 (kinetic), both intermediate milestones—23.04 (lunar) and 23.10 (mantic)—have also moved off archive.ubuntu.com onto old-releases.ubuntu.com. Running do-release-upgrade directly downloads noble.tar.gz and exits with an unsupported-path error.

Before fetching the archived upgrader tarballs, always clear two silent blockers that cause mid-upgrade solver failures:

  1. Park Third-Party Lists & Priority-600 CUDA Pins: Files such as /etc/apt/preferences.d/cuda-repository-pin-600 pin vendor packages above Ubuntu's core archive priority (500), preventing libc6, GCC, and kernel transitions from resolving cleanly.
  2. Verify /boot/efi Headroom & Snapshot Installed Selections: Record your starting package and Snap inventory so nothing critical is lost if an obsolete package is removed.
# Save package inventories & check filesystem headroom
dpkg --get-selections > ~/installed-packages-before-upgrade.txt
snap list --all > ~/installed-snaps-before-upgrade.txt
df -h / /boot /boot/efi

# Park third-party repositories and high-priority pins safely
sudo mkdir -p /etc/apt/backup-before-upgrade/sources.list.d /etc/apt/backup-before-upgrade/preferences.d
sudo mv /etc/apt/sources.list.d/* /etc/apt/backup-before-upgrade/sources.list.d/
sudo mv /etc/apt/preferences.d/* /etc/apt/backup-before-upgrade/preferences.d/ 2>/dev/null || true

# Point EOL base sources.list to old-releases.ubuntu.com if not already updated
sudo sed -i 's|http://.*archive.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g; s|http://security.ubuntu.com/ubuntu|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list
sudo apt-get update && sudo apt-get -y full-upgrade

2. Running the Sequential Archive Upgraders Inside tmux

Each archived Ubuntu release publishes its standalone upgrader archive under dists/<codename>-updates/main/dist-upgrader-all/current/, and its internal mirrors.cfg explicitly recognizes old-releases.ubuntu.com. Always run inside tmux (note: launch tmux first, then paste commands inside the new shell—pasting tmux new and upgrade commands simultaneously leaves the upgrade commands buffered in the outer shell!):

# Hop 1: 22.10 (kinetic) -> 23.04 (lunar)
mkdir -p ~/upgrade-lunar && cd ~/upgrade-lunar
curl -fsSLO http://old-releases.ubuntu.com/ubuntu/dists/lunar-updates/main/dist-upgrader-all/current/lunar.tar.gz
tar -xzf lunar.tar.gz
sudo env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a ./lunar --frontend=DistUpgradeViewNonInteractive --disable-gnu-screen

# Verify DKMS & initramfs before rebooting into 23.04
dkms status && ls -lh /boot/vmlinuz* /boot/initrd*

# Hop 2 (after reboot): 23.04 (lunar) -> 23.10 (mantic)
mkdir -p ~/upgrade-mantic && cd ~/upgrade-mantic
curl -fsSLO http://old-releases.ubuntu.com/ubuntu/dists/mantic-updates/main/dist-upgrader-all/current/mantic.tar.gz
tar -xzf mantic.tar.gz
sudo env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a ./mantic --frontend=DistUpgradeViewNonInteractive --disable-gnu-screen

# Hop 3 (after reboot): 23.10 (mantic) -> 24.04.5 LTS (noble)
# noble's DistUpgradeController automatically switches old-releases.ubuntu.com back to archive.ubuntu.com
sudo do-release-upgrade -f DistUpgradeViewText

# Pin future release checks strictly to 5-year LTS milestones & add HWE 7.0 kernel
sudo sed -i 's/^Prompt=.*/Prompt=lts/' /etc/update-manager/release-upgrades
sudo apt-get -y install linux-generic-hwe-24.04

3. Reclaiming 54 GB of Hidden Bloat & Consolidating Desktop Sessions

Multi-hop upgrades leave gigabytes of invisible baggage across system directories that standard apt autoremove never touches. Auditing the upgraded workstation surfaced 54 GB of safe, zero-data-loss savings:

Bloat Category Space Freed Safe Cleanup Command / Action
Stale Local CUDA & cuDNN Repo Mirrors (/var/cuda-repo-*) 12.0 GB sudo apt-get purge 'cuda-repo-*-local' 'cudnn-local-repo-*' (keeps installed CUDA toolkit intact)
24 Disabled Snap Revisions & Unused Runtimes 10.7 GB Remove disabled revisions in snap list --all; set sudo snap set system refresh.retain=2
User Build & Browser Caches (~/.cache/pip, Gradle) 17.0 GB Clear ~/.cache/pip (11 GB alone!), ~/.gradle/caches, and orphaned IDE caches
Extra Desktops, IDEs & Login Managers 8.1 GB Protect cinnamon + gdm3 with apt-mark manual before purging unused DEs & Snaps
APT Archives, Systemd Journals & 191 rc Configs 7.2 GB sudo apt-get clean, sudo journalctl --vacuum-size=200M, dpkg --purge on ^rc
Critical GDM3 Dependency Guardrail: When removing extra desktop environments to standardize on Cinnamon + GDM3 (set via org.freedesktop.Accounts.User.SetSession "cinnamon"), never purge gnome-shell—Ubuntu's gdm3 login greeter depends directly on gnome-shell and gnome-session-bin! Always run apt-mark manual cinnamon cinnamon-core gdm3 xorg network-manager and verify with apt-get -s purge first.

4. Shaving 2 Full Minutes Off Boot Time (`systemd-networkd-wait-online`)

Running systemd-analyze blame after the upgrade revealed userspace boot was taking 2 minutes 52 seconds—with 2min 227ms spent inside a single failing unit: systemd-networkd-wait-online.service. On multi-NIC workstations managed by NetworkManager where a secondary Ethernet port sits unplugged (DOWN), systemd-networkd-wait-online blocks multi-user targets until its 120-second timeout expires (and an old Snort IDS daemon was even sitting in RAM sniffing that same unplugged interface!). Disabling the redundant wait unit cuts boot time under 50 seconds.

5. Fixing the "Stuck at 1600x900" NVIDIA HDMI 0-Byte EDID Lockout

During the 24.04 upgrade, Ubuntu replaced an older 575 driver with nvidia-driver-580-server-open, and the 4K monitor came up locked at 1600x900. Upgrading to the desktop proprietary nvidia-driver-595 package cleaned up the driver stack—yet the screen stayed at 1600x900. Checking kernel DRM connector telemetry exposed the real culprit:

# Check whether the monitor/cable is actually delivering EDID bytes to the kernel
for p in /sys/class/drm/card*-*; do
  [ -f "$p/status" ] && echo "$(basename "$p"): status=$(cat "$p/status") edid_bytes=$(wc -c < "$p/edid" 2>/dev/null || echo 0)"
done
# Output: card1-HDMI-A-1: status=connected edid_bytes=0

Because the HDMI link returned zero EDID bytes (common with aging HDMI cables, KVM switches, or monitor DDC hiccups), NVIDIA's Xorg driver capped DFP-0 at a safe single-link fallback pixel clock of 165.0 MHz (1600x900 max), and Cinnamon saved a fallback <vendor>???</vendor> profile inside ~/.config/monitors.xml. Adding a clean Xorg override unlocked native 4K and 1440p modes immediately even without hardware EDID:

# /etc/X11/xorg.conf.d/20-nvidia-hdmi-modes.conf
Section "Monitor"
    Identifier     "HDMI-0-Monitor"
    HorizSync       28.0 - 160.0
    VertRefresh     24.0 - 75.0
    Option         "UseEDIDFreqs" "false"
    Modeline       "1920x1080_60" 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
    Modeline       "2560x1440_60" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
    Modeline       "3840x2160_30" 297.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync
    Modeline       "3840x2160_60" 594.00 3840 4016 4104 4400 2160 2168 2178 2250 +hsync +vsync
EndSection

Section "Device"
    Identifier     "NVIDIA-GPU"
    Driver         "nvidia"
    BusID          "PCI:1:0:0"
    Option         "AllowEmptyInitialConfiguration"
    Option         "Monitor-HDMI-0" "HDMI-0-Monitor"
    Option         "ModeValidation" "HDMI-0: AllowNonEdidModes, NoMaxPClkCheck, NoEdidMaxPClkCheck, NoHorizSyncCheck, NoVertRefreshCheck, NoDFPNativeResolutionCheck"
EndSection

Troubleshooting Questions During Multi-Hop Ubuntu Upgrades

Why did sudo tee write a 0-byte config file when scripted with a piped password?

Piping a password to sudo -S tee /etc/file <<'EOF' feeds standard input to sudo, consuming or overriding the heredoc stream meant for tee. Either configure scoped NOPASSWD sudoers validated via visudo -cf, or stage the file in /tmp and promote it atomically with sudo install -o root -g root -m 0644, verifying non-empty contents afterward.

Should we reboot between every intermediate Ubuntu release hop?

Yes. Each hop replaces systemd, dbus, glibc, the Linux kernel, and NVIDIA DKMS modules. Verifying dkms status and rebooting between hops isolates any bootloader or display issue immediately rather than compounding three kernel transitions at once.

Continue Through the 5-Part Linux Hardening Series

Next up: compiling upstream mainline NGINX 1.31.10 from source with full GCC 13 binary exploit mitigations and TLS 1.3 hardening—or talk with us about scoping an infrastructure baseline review.

INTERACTIVE LINUX KERNEL LPE & SHADOW-$PATH LAB

Evaluate kernel LPE sysctls & user-space $PATH shims

Toggle your Ubuntu kernel/AppArmor posture and io_uring + $PATH shim state to preview privilege-escalation exposure and copy a one-shot audit & lockdown snippet.

01 / KERNEL & APPARMOR USERNS POSTURE
02 / IO_URING & SHADOW-$PATH SHIMS
Runtime memory boundary and containment diagramUNTRUSTED INPUTPre-Auth StreamHTTP / SOCKETRUNTIME GATEUnpatched StubOVERFLOW PATHWORKER HEAPExposed MemoryACTION NEEDED
HIGH LPE & SHADOW-RUNTIME EXPOSURE • KERNEL RINGS & SHIMS OPEN

Unrestricted io_uring rings, global userns rollbacks, or forgotten ~/.nvm and herd-lite binaries leave local root escalation and *2Shell paths reachable.

which -a php node java javac
sudo sysctl kernel.io_uring_disabled kernel.apparmor_restrict_unprivileged_userns dev.tty.ldisc_autoload