Overwrite Ubuntu 22.04 to Debian Trixie, the YOLO approach
debian ubuntu docker
For the past several years, my once mighty Thinkpad X1 Extreme has been doing duty (fantastically I might add) as my all-purpose Linux server at home.
This includes but is not limited to Pi-hole for automatic house-wide ad-blocking, Home Assistant for “monitoring the situation” with a number of devices at home (solar system, hot water geyser, various services), webdav for my zotero PDFs, my miniflux RSS reader running behind a Cloudflare tunnel, and more recently my AI agents.
Long story short, Homebrew on Linux recently started requiring a GLIBC that the aging Ubuntu 22.04 on the Thinkpad could not supply, and so the time came for an upgrade.
Because Ubuntu LTS distributions only allow upgrades to the subsequent LTS, I would have had to upgrade from 22.04 to 24.04, and then to 26.04.
Instead of taking this scenic route, I decided to throw my toys out of the cot by installing Debian Trixie right into the existing filesystem, as I hoped to retain as much as possible of my system configuration, which consists almost entirely of a collection of docker-compose.yml files in my home directory. My case was somewhat complicated by the fact that I have a single giant 1 TB partition, so no separate /home mount.
The whole process turned out to be quite painful, but fortunately only for the 15 minutes in the middle when everything seemed to be entirely broken.
Early on, the Debian installer’s debootstrap refused to move an inch further, until I ctrl-alt-f4’d out of there, and rm -rf'd large chunks of the old system files out of /target until the system finally started plonking in the forwards direction.
At first boot, I was met with an empty /etc/fstab on a read-only filesystem mount, remedied with a remount and some gratuitous freestyle fstab poetry, after which I was able to YOLO ahead.
Fast forward some more minutes of docker compose up -d-ing the various services, and restoring the bits of /etc/ I did remember to backup before the nuke (tailscale, cloudflare), and we were almost good as new.
The only real casualty was my complete miniflux RSS subscription library, which lives in the accompanying postgres service’s storage volume!😭
Lesson learned: Prefer the humble bind-mounted subdirectory over a docker volume for your postgres service so that you only have to backup that one folder containing the docker compose setup.
I restored an old 2024 OPML I had, and then generously applied me noggin to reconstruct some of the missing subscriptions.
To summarize: If you can keep your head cool, you can absolutely overwrite an Ubuntu 22.04 filesystem with the Debian Trixie installer and live to tell the tale in 30 minutes or so. Having most of your important services running from single localized directory tree helps. Having a separate /home would have made this even easier, but I think I’ll stick to my single big partition for a few years more.
Comments via 🦋