Skip to content

Instantly share code, notes, and snippets.

@sulincix
Last active April 11, 2022 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sulincix/1aeeb6ff99ea14e1ff76afc301b25785 to your computer and use it in GitHub Desktop.
Save sulincix/1aeeb6ff99ea14e1ff76afc301b25785 to your computer and use it in GitHub Desktop.
debian remove systemd
#!/bin/bash
if [[ $UID -ne 0 ]] ; then
echo "You must be root"
exit 1
fi
apt update
# Block service invoke
echo -e "#!/bin/sh\nexit 101" > /usr/sbin/policy-rc.d
chmod +x /usr/sbin/policy-rc.d
# Remove systemd preremove script.
rm -f /var/lib/dpkg/info/systemd.prerm
# Install sysv-init and elogind
apt install elogind sysvinit-core sysv-rc -y --allow-remove-essential
apt install -f
apt full-upgrade -y
apt autoremove -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment