This is a generic howto that explains how to get rid of systemd in a distro based on Debian Buster, like the beta version of Elive 3.8.xx
Feel free to edit and improve this howto in order to make the final system more compatible for all
First things to know
- removing systemd will save you some RAM, around ~60 MB of it
- removing systemd can make things broken, not working as expected, etc (but we try to solve them all on this howto so that you can have a final working system)
- it is suggested to backup your entire system, this is a major change in your OS
- there's known issues, read them before
Known Issues / TODO's:
- none yet
Let's do it !
-
First you need to access to a shell in the machine where you want to remove systemd and using sysvinit instead, we strongly suggest to be logged on console mode or via ssh, you must logout from your graphical session first too, and its strongly suggested to be connected to internet via LAN cable instead of wifi. Finally, is suggested also to run your users-manager tool to disable user autologin during this process.
-
You need now to get the Devuan gpg key in order to use their repositories, copy and paste this to your terminal:
cd /tmp
wget "http://deb.devuan.org/devuan/pool/main/d/devuan-keyring/$( curl -sL http://deb.devuan.org/devuan/pool/main/d/devuan-keyring/ | grep "href.*devuan-keyring_.*all.deb" | sed -e 's|^.*href="||g' -e 's|".*$||g' )"
sudo dpkg -i devuan-keyring*deb
- Now add the repositories as:
echo "# Devuan repos:
deb http://deb.devuan.org/merged beowulf main contrib non-free
deb http://deb.devuan.org/merged beowulf-updates main contrib non-free
deb http://deb.devuan.org/merged beowulf-security main contrib non-free
deb http://deb.devuan.org/merged beowulf-backports main contrib non-free
" | sudo tee /etc/apt/sources.list.d/bbb-devuan.list
- Let's do the things in the correct way and add a little higher priority to the Devuan repos against the Debian ones:
echo "Package: *
Pin: release o=Devuan
Pin-Priority: 600" | sudo tee /etc/apt/preferences.d/devuan.pref
- Now, update your packages lists and upgrade your system to updated packages from Devuan:
sudo apt-get update
sudo apt-get upgrade
note: don't use dist-upgrade on this step, we need a soft upgrade first
Now this is an important step, you will install a needed package and you will need to note somewhere the list of what is going to be removed, because you need to install it later (or their replacements), we will continue the howto with a list based on Elive 3.8.14 as an example of this list
- Remove dependencies that won't work later:
sudo apt-get remove network-manager\* wpasupplicant
- Install required packages and write a list of the things that is going to be removed from your system, for example:
sudo apt-get install eudev
sudo apt-get install eudev
sudo apt-get -f install
yes, you probably need to install eudev twice, due to a systemd error you need to be insistent.
Now, make a look to the packages it wants to remove:
...
Suggested packages:
bootlogd
Recommended packages:
libpam-ck-connector
The following packages will be REMOVED:
cairo-dock dbus-user-session eltrans gdebi gksu gnome-settings-daemon libpam-systemd plymouth plymouth-label policykit-1 policykit-1-gnome synaptic systemd systemd-sysv usb-bootable-elive lightdm
Make sure that it correctly uninstalled systemd and it regenerated your initramfs, otherwise you may need to try the step again after to reboot
-
Now its time to reboot your machine, in order to boot with sysvinit and not using systemd. 1WARNING: after to reboot you may not have internet available and maybe not the graphical system running too!
-
You may need to reconnect later to internet via LAN cable, which your interface can be similar to enp0s3, so you can do:
sudo dhclient -v en<TAB>
sudo dhclient -v eth0
-
Its suggested also to logout again from your graphical system to continue configuring your new system
-
Now, install the remaining needed things for your new system:
sudo apt-get install elogind libpam-elogind
- Now, continue your change to sysvinit by upgrading fully your system:
sudo apt-get dist-upgrade
sudo apt-get remove systemd libnss-systemd
Install back all the needed software (or alternatives)
This step is a bit delicated and may need to you try the steps one to one:
If you want to use again network-manager, which fortunately stills supported and its suggested if you had it before:
sudo apt-get install network-manager network-manager-gnome network-manager-openvpn-gnome network-manager-pptp-gnome network-manager-vpnc-gnome network-manager-fortisslvpn-gnome network-manager-l2tp-gnome network-manager-openconnect-gnome network-manager-ssh-gnome network-manager-strongswan dnsmasq gnome-keyring
Cairo-dock seems to compatible too, but you need to reinstall it entirely in order to use all the modified packages from the Devuan repos, removing the ones from debian first, so:
sudo apt-get remove cairo-dock\*
sudo apt-get clean
sudo apt-get install cairo-dock libexo-1-0 cairo-dock-gnome-integration-plug-in cairo-dock-dbus-plug-in-interface-python
Login manager, if you used Lightdm:
sudo apt-get install lightdm lightdm-gtk-greeter
Plymouth (boot splash) doesn't seems to be compatible, but is not a big issue if we don't have it
Some specific packages / dependencies by Elive you may want to have back:
sudo apt-get install gdebi gksu eltrans synaptic usb-bootable-elive gnome-settings-daemon policykit-1 policykit-1-gnome
Note: If you use an experimental version of the enlightenment desktop (so, not customized by Elive yet), you need to make sure that all the autostart applications needed are included in the init of the destkop, otherwise you may have features not working like dbus or mounts
Cleanups
After you have installed the needed software or reinstalled the previous one, its a good thing to cleanup your system:
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get autoclean
Post configurations
Shutdown / reboot privileges
Your user won't have shutdown and similar privileges, so its recommended to add it your sudo settings:
echo "# give admin privileges to user $USER to be able to shutdown / reboot / suspend the computer
$USER ALL=(ALL) NOPASSWD: /sbin/halt
$USER ALL=(ALL) NOPASSWD: /sbin/shutdown
$USER ALL=(ALL) NOPASSWD: /sbin/poweroff
$USER ALL=(ALL) NOPASSWD: /sbin/reboot
$USER ALL=(ALL) NOPASSWD: /usr/sbin/pm-hibernate
$USER ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend
$USER ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend-hybrid
" | sudo tee /etc/sudoers.d/sudo_nopasswd_power_$USER
note: is important to run this command as user and not root, otherwise you must change the USER variable to the static user to use
This may or may not work on other systems, in an updated Elive will directly work from your window manager
Stability improvements
As you have seen, we needed to remove first all the cairo-dock packages that we had previously installed in order to force-download them again but from the devuan repos instead, otherwise they wont install or could mess the entire system (that's just an example of how mixing repos is a very delicated thing that can mess your entire system).
Your system is ready and usable now, but if you want to work from it as a stable system I would recommend to force-reinstall all the packages in your system that there's a version available on devuan, don't worry, our apt configurations set to devuan will make your system select the correct ones automatically.
Warning: this step can take up to 1 hour and can use at least 1GB of your network bandwith
unset list
export DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical DEBCONF_NONINTERACTIVE_SEEN=true DEBCONF_NOWARNINGS=true
sudo apt-get clean
for package in $( dpkg -l | grep "^ii" | awk '{print $2}' ) ; do if apt-cache madison "$package" | grep -qs "devuan.org" ; then echo "including: $package" ; list="$package $list" ; fi ; done
sudo apt-get install --reinstall $list
# fixes:
sed -i -e 's|^set -e|#set -e|g' /var/lib/dpkg/info/firmware-b43-installer.prerm /var/lib/dpkg/info/firmware-b43*installer*
sudo apt-get -f install
You may have some broken packages, like the b43 firmwares (which we have already included hte fix in the previous command) so its up to you to fix them
Optionally, this step could have been done before to start installing back the wanted packages, but the result should be the same, you can do it especially if you have difficulties with broken dependencies
note: this option has not been very tested but is meant to stability your system to not have issues in the future with your repositories
Notes:
- Since you reinstalled so many packages in your system, a last reboot is suggested even if should be not needed
- An installed 3.8.14 (32bit) system with the default preselected options (which means: you can install it even lighter), that resulted in 221 MB of RAM used with all the desktop featured running, turned to use only 175 MB uses only after to switch from systemd to sysvinit, plus:
- 150 MB with pulseaudio removed
- 121 MB without using cairo-dock
- 170 MB switching to E24 (without pulseaudio and without cairo-dock too)
Note: Seems like Bullseye has a better support for switching to other init systems: Init - Debian Wiki
Please improve this howto to make it better, after to betatest the resulting system you may see things that must be improved, fixes, or compatibility things