1

This question already has an answer here:

systemd still maintains the general idea of runlevels with its "Targets", but how do I change the system runlevel through systemd?

I want to do something equivalent to the old init-script method of:

init 3 # Multi-user
init 5 # Graphical

marked as duplicate by Jeff Schaller, Christopher, Stephen Kitt, Stephen Harris, jimmij Feb 6 at 9:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • That's because you are looking for something that in the systemd world is obsolete. Forget about runlevels, as I said in an answer to that very question. – JdeBP Feb 2 at 0:50
  • Questions in other Answers are exactly what "Duplicates" are for. – Jeff Schaller Feb 5 at 16:10
  • Yes, the answer for that Question would have answered this Question, but the Question itself was different. – palswim Feb 5 at 18:13
3

From freedesktop.org's own systemd FAQ, to change the (running) Target (system runlevel), use systemctl isolate TARGET.target:

systemctl isolate multi-user.target # or runlevel3.target
systemctl isolate graphical.target # or runlevel5.target

To change the default Target (default system runlevel, for the next reboot), use systemctl set-default TARGET:

systemctl set-default multi-user.target
systemctl set-default graphical.target

Not the answer you're looking for? Browse other questions tagged or ask your own question.