It will differ by distro, but generally for debian, you begin uninstalling systemd by installing something else like SysV init
:
apt install sysvinit-core sysvinit-utils
cp /usr/share/sysvinit/inittab /etc/inittab
Then you will need to configure grub by editing /etc/default/grub
changing:
GRUB_CMDLINE_LINUX_DEFAULT="init=/bin/systemd console=hvc0 console=ttyS0"
to
GRUB_CMDLINE_LINUX_DEFAULT="init=/lib/sysvinit/init console=hvc0 console=ttyS0"
and then executing update-grub
as root.
Then you can reboot so that the system boots off of sysvinit instead and then purge systemd with apt-get remove --purge --auto-remove systemd
. This also removes packages that depend on systemd.
Then you pin systemd packages to prevent apt from installing systemd or systemd-like packages in the future.
echo -e 'Package: systemd\nPin: release *\nPin-Priority: -1' > /etc/apt/preferences.d/systemd
echo -e '\n\nPackage: *systemd*\nPin: release *\nPin-Priority: -1' >> /etc/apt/preferences.d/systemd
Depending on if the distro is multiarch, you might also need:
echo -e '\nPackage: systemd:amd64\nPin: release *\nPin-Priority: -1' >> /etc/apt/preferences.d/systemd
echo -e '\nPackage: systemd:i386\nPin: release *\nPin-Priority: -1' >> /etc/apt/preferences.d/systemd
This information was sourced from this wiki dedicated specifically to removing systemd on multiple distributions and replacing it with something else:
Of course, no worries. I seemed to recall there was something out there for this because I read some article a while back that was discussing the scope-creep in systemd, and the problems that result from it. I think I found this wiki originally at that time.