The Linux Ship of Theseus
-
pick any distro and install it.
-
Then, without installing another distro over the top of it, slowly convert it into another distro by replacing package managers, installed packages, and configurations.
System must be usable and fully native to the new distro (all old packages replaced with new ones).
No flatpaks, avoid snaps where physically possible, native packages only.
EDIT: Some clarification on some of the clever tools brought up here:
chroot
, dd
, debootstrap
, and partition editors that allow you to install the new system in an empty container or blanket-overwrite the old system go against the spirit of this challenge.
These are very useful and valid tools under a normal context and I strongly recommend learning them.
You can use them if you prefer, but The ship of Theseus was replaced one board at a time. We are trying to avoid dropping a new ship in the harbor and tugging the old one out.
It may however be a good idea to use them to test out the target system in a safe environment as you perform the migration back in the real root, so you have a reference to go by.
Easy: pick two similar distros, such as Ubuntu and Debian or Manjaro and Arch and go from the base to the derivative.
Medium: Same as easy but go from the derivative to the base.
Hard: Pick two disparate distros like Debian and Artix and go from one to the other.
Nightmare: Make a self-compiled distro your target.
without installing another distro over the top of it … [replace] package managers
The package manager is the distro, though.
$ pacman -S apk-tools $ apk add alpine-base linux-lts
Then
kexec
to alpine’s kernel and theinitramfs
generated by its installation (which would incidentally “replace” PID 1 with the new/sbin/init
). For clean up you could take a diff of “tar -t
” for all the installed packages from both distros then delete the files only in the old distro’s packages.Make a self-compiled distro your target.
Replace the first step with a compilation of
apk
,abuild
everything required byalpine-base
andlinux-lts
(git clone aports
to bootstrap that work), then add the package directory to/etc/apk/repositories
before the second step. Next, begin to worry that you haven’t fully broken free yet, replaceabuild
with a bespokemybuild
andapk
withtar -x
, grapple with signed binaries, reflect on your own identity and authenticity, then take a tour throughgentoo
and find yourself missing the$HOME
you left and its familiar comforts.Theoretically one could also prohibit rebooting.
IIRC
kexec
is pivot_root but for the kernel.I would watch a YouTube series doing this
Not quite the same but you might like the Linux from Nothing series, building out a Linux install from first principles.
Obviously lots of linux youtubers have done videos on linux from scratch too but the step by step nature is pretty enjoyable to watch.
whoever runs the channel will singlehandedly cause a worldwide antidepressant shortage
Reminds me of MattKC, a guy on YouTube who does similar stuff. He ported the .Net framework to win95. very interesting videos, if think this challenge would be exactly his type.
Love him. His lego island port has been a pleasure to watch.
Oh he’s the Lego Island guy, I thought he sounded familiar.
New Game+: speedrun it
I “broke” linux mint just by trying to pop KDE on, had to timeshift because it messed up my keyboard layout and a whole bunch of other things with my display.
I don’t know how people do these crazy changes without pain, and have a feeling the answer is simply “there’s pain” 😂
Reminds me of trying NsCDE… it changed a ton of settings and no other desktop looked right after that. I ended just blowing away my home folder and restoring my files
theres pain but its also very satisfying to pull this kind of stuff off. im more of a stable system kind of guy these days tho.
It is quite easy to go slackware -> gentoo from what I remember but minimalist distros might be cheating
Linux From Scratch rulez!
Migrate from Nix to Linux From Scratch!
Is that even possible? I’m already in panic when I remove a package and it’s dependencies with pacman 😅.
Sure I did replaced Thunar with Nemo, but a few things don’t work exactly how it should, like opening the download directory from Firefox (Known issue BTW) even though all mime-types are correctly set !
Even switching from Alternative -> Base distro seems like a really difficult task :/
Possible? Absolutely. Pleasant? Hell, no.
I helped do the easy scenario at large scale in a fortune 50 several years ago after the vendor thought they could get greedy on the support contract renewal. Only required small changes to a few files and packages.
Hell: from macOS to WSL.
But the rules say the system must be usable.
“Medium: Same as easy but go from the derivative to the base.”
I can’t quite recall, but I think I did exactly that with Ubuntu -> Debian once upon a time. I think Ubuntu was only a year or so old though, so there wasn’t a huge amount of divergence back then. As a bonus anecdote I also attempted a semi-successful build of Gentoo on a PPC Mac around the same time (nothing before or after that has compared in its level of nightmare).
I also attempted a semi-successful build of Gentoo on a PPC Mac around the same time (nothing before or after that has compared in its level of nightmare).
Amen!
The compiled distros should be easy instead of nightmare tbh
I think it would be very interesting to convert e.g. a regular Fedora installation into a (so-called “immutable”) Fedora Silverblue installation or vice-versa.
Okay i’ll cheat with Guix then
Reminds me of a recent post someone converted their system from Debian to OpenBSD via SSH only
Why does that sound familiar.
Did they load an OS into ram to run ssh then rebuild the machine, also some VPS that the provider was dragging their feet on remote hands.
I can’t find it now but basically something like that yeah. VPS provider only gave them SSH on linux so couldn’t run the openbsd installer any normal way either
debootstrap makes this easy, and familiarity with that process introduces chroot skills.
This goes against the spirit of the challenge, but as its a singleplayer game (unless you bring friends and SSH!) you can definitely choose to allow dd, chroot, and similar tools
it is pretty terrifying to debootstrap over ssh. constantly checking that you’re on the correct system, and using the chrooted terminal. it’s like a high wire act. at least the first few times.
Oh I totally believe that. I can imagine how stressful that is.