How to remove systemd from a Debian jessie/sid installation

From Without Systemd
(Difference between revisions)
Jump to: navigation, search
m (fix minor typo)
(Double pipe. systemd-shim.)
Line 7: Line 7:
 
# echo -e 'Package: systemd\nPin: origin ""\nPin-Priority: -1' > /etc/apt/preferences.d/systemd
 
# echo -e 'Package: systemd\nPin: origin ""\nPin-Priority: -1' > /etc/apt/preferences.d/systemd
 
Prevent apt from installing any systemd like packages in the future (note the star before and after systemd)
 
Prevent apt from installing any systemd like packages in the future (note the star before and after systemd)
# echo -e 'Package: *systemd*\nPin: origin ""\nPin-Priority: -1' > /etc/apt/preferences.d/systemd
+
# echo -e '\n\nPackage: *systemd*\nPin: origin ""\nPin-Priority: -1' >> /etc/apt/preferences.d/systemd
  +
Note: This prevents the installation of the package [https://packages.debian.org/de/jessie/systemd-shim systemd-shim] as well. However this is a emulation of systemd functions, so you can install software which depends on systemd. So if you get "Package systemd-shim is not available, but is referred to by another package." you might temporary disable the three lines in the preferences.d/systemd file.
   
 
In the case your system uses multiarch (mixed 32 and 64bit packages), you need to pin the 64bit version of systemd too. Otherwise apt-get could still install it as dependency later.
 
In the case your system uses multiarch (mixed 32 and 64bit packages), you need to pin the 64bit version of systemd too. Otherwise apt-get could still install it as dependency later.

Revision as of 23:02, 21 June 2015

First install the SysV init packages

# apt-get install sysvinit-core sysvinit sysvinit-utils

Then reboot your machine and remove all of the systemd packages. BE AWARE that the following command removes packages that depend on systemd itself or things like libpam-systemd!

# apt-get remove --purge --auto-remove systemd

Prevent apt from installing systemd packages in the future.

# echo -e 'Package: systemd\nPin: origin ""\nPin-Priority: -1' > /etc/apt/preferences.d/systemd

Prevent apt from installing any systemd like packages in the future (note the star before and after systemd)

# echo -e '\n\nPackage: *systemd*\nPin: origin ""\nPin-Priority: -1' >> /etc/apt/preferences.d/systemd

Note: This prevents the installation of the package systemd-shim as well. However this is a emulation of systemd functions, so you can install software which depends on systemd. So if you get "Package systemd-shim is not available, but is referred to by another package." you might temporary disable the three lines in the preferences.d/systemd file.

In the case your system uses multiarch (mixed 32 and 64bit packages), you need to pin the 64bit version of systemd too. Otherwise apt-get could still install it as dependency later.

# echo -e '\nPackage: systemd:amd64\nPin: origin ""\nPin-Priority: -1' >> /etc/apt/preferences.d/systemd

In other multiarch cases where amd64 is the default architecture, you may have to pin the i386 package to prevent APT from installing it:

# echo -e '\nPackage: systemd:i386\nPin: origin ""\nPin-Priority: -1' >> /etc/apt/preferences.d/systemd
Personal tools