1. error reason
this error came from here:
/var/lib/dpkg/info/systemd.prerm
# Prevent systemd from being removed if it's the active init. That # will not work. # if [ "$1" = "remove" ] && [ -e /sys/fs/cgroup/systemd ]; then echo "systemd is the active init system, please switch to another before removing systemd." exit 1 fi
2. resolve & remove
see systemd cgroup mounts (mounted by /lib/systemd/systemd)
mount ... tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd) cgroup on /sys/fs/cgroup/debug type cgroup (rw,nosuid,nodev,noexec,relatime,debug) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
umount them, and try to remove again:
apt-get remove systemd
OR
apt-get purge systemd
that's worked for me.
3. after remove
then other service manager maybe needed, sysvinit or upstart or something else.