Ubuntu 23.04
Sponsored Link

Change Run-Level2023/04/24

 
If you would like to change System Run-Level, set like follows.
[1] Run-Level is set with linking to [/etc/systemd/system/default.target].
For example, the default setting without GUI is set like follows.
root@dlp:~#
systemctl get-default

multi-user.target
root@dlp:~#
ll /etc/systemd/system/default.target

lrwxrwxrwx 1 root root 37 Apr 24 15:19 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target
root@dlp:~#
ll /lib/systemd/system/multi-user.target

-rw-r--r-- 1 root root 540 Jan 26 17:12 /lib/systemd/system/multi-user.target
[2] For example, if you'd like to change Run-Level to Graphical-Login, set like follows.
On Ubuntu and other Debian based System, Graphical-Login is enabled automatically when installing Desktop Environment packages, however if you'd like to disable Graphical-Login by default, specify [multi-user.target].
root@dlp:~#
systemctl set-default graphical.target

Removed /etc/systemd/system/default.target.
Created symlink /etc/systemd/system/default.target → /lib/systemd/system/graphical.target.
root@dlp:~#
systemctl get-default

graphical.target
root@dlp:~#
ll /etc/systemd/system/default.target

lrwxrwxrwx 1 root root 36 Apr 24 15:20 /etc/systemd/system/default.target -> /lib/systemd/system/graphical.target
Matched Content