Systemctl get-default differs from default.target link

systemd

The default target returned by systemctl

[user@host system]$ systemctl get-default
multi-user.target

differs from the value of the /usr/lib/systemd/system/default.target link:

[user@host system]$ ls -l /usr/lib/systemd/system/default.target
lrwxrwxrwx. 1 root root 16 Mar 10 21:20 /usr/lib/systemd/system/default.target -> graphical.target

My understanding was that these were one and the same. If systemd doesn't store the default value as the default.target symlink, where is the real value of the default target stored by systemd?

Best Answer

This is most likely because /etc/systemd/system/default.target exists and points to multi-user.target

If you change the default.target with systemctl set-default [unit], the new default.target link is created in /etc/systemd/system/. The existing /usr/lib/systemd/system/default.target is not changed when using the set-default command. Like with all systemd units, the ones in /etc take precedence over /usr.