Gentoo Without systemd

Having trouble with being pulled in your emerges for no apparent reason? Read this article in order to find out how to resolve this problem.

Why is systemd pulled in?
Most packages depending on systemd actually depend on systemd or OpenRC or some other init system. If no other init system is installed Portage will attempt to install the first in the list, which, in most cases, will be systemd.

This is perfectly normal behavior; Portage cannot magically guess which init system the user prefers. In order to help Portage understand that the users have preferences a USE flag can be defined to describe user preferences directly. That is the magic of the USE flag system.

systemd USE flag
Add  to the system's USE variable in.

Mask systemd and udev
In order to explicitly inform Portage to never install systemd, a mask file will need to be created. Masks can be created a two different ways. Either create a FOLDER called in  then create individual text files containing lists of packages to be masked OR create a FILE called  and organize it all in one big file. Portage will be happy with either method. The choice is left up to the system administrator. Why two ways? Well, it would appear two methods continue to exist for organizational purposes. Some users like having everything defined in one file, while other users like having each set of packages masked in separate folders.

OR

Masking udev will always not result in a broken system; Portage is smart enough to automatically replace udev by pulling in : the systemd-free fork of udev.

Troubleshooting
Some packages must have systemd or udev in order to operate. Masking systemd and udev (the step above) will prevent the system from installing or upgrading these packages.