The last time Hackerfall tried to access this page, it returned a not found error. A cached version of the page is below, or click here to continue anyway

Prevent systemd installation on Ubuntu 14.04 and other Debian based distros

If the mountain wont come to Muhammad then Muhammad must go to the mountain.

Oddly, this proverb applies to systemd as well. Its rapidly making its way to all the major distros. Love it, or hate it, its here to stay.

The thing that throws me off the most, is its intrusiveness. When you install systemd, it literally plows through the wall, and doesnt bother with the door. This is especially true if you are running an older Ubuntu, like 14.04. As packages are rapidly adopting systemd as a dependency, theres a good chance that it will surprise you with a visit. Sooner than you think.

I had a minimalistic Ubuntu Trusty environment, and upon updating Java to 8u121, systemd joined the party as well, breaking SSH and some other crucial services. It also drank all the beer. Java version 8u111 didnt have it as an indirect dependency.

Heres how to prevent systemd from ruining your party:

# create an APT config file
$ sudo vi /etc/apt/preferences.d/systemd
# paste this snippet and save -- make sure there's no indentation
Package: systemd
Pin: release *
Pin-Priority: -1
# at this point, the walls are reinforced and the beer is restocked

In a nutshell, by setting the Priority to a negative number, APT installations will skip the systemd package, even if it is a dependency. Check out the apt_preferences man page for more info. I will probably revisit it in another post.

Alternatively, the same can be achieved with the --no-install-recommends option for apt-get install, when systemd isnt a direct dependency, but then you might miss out on some valuable packages, like dbus in my case. You can broaden the match by putting an asterisk (*) around the package name, but in this case, I think its an overkill. You may want to install timedatectl without installing systemd, which is part of the systemd-services package in Trusty. With limiting our match to systemd only, the systemd-services package can happily bring in timedatectl without reaping havoc.

Done.

Continue reading on ervinb.github.io