You can switch the boot target to text or GUI (graphical user interface) mode in a systemd Linux system using the systemctl
command.
sudo systemctl set-default multi-user.target
This will set the default boot target to multi-user.target
, which will boot the system into text mode.
sudo systemctl set-default graphical.target
This will set the default boot target to graphical.target
, which will boot the system into GUI mode.
sudo systemctl reboot
Note: These commands assume that you have root access to your system. You will need to use
sudo
to run them.
You can also switch between text and GUI mode by using the systemctl isolate
command. For example:
sudo systemctl isolate multi-user.target # Switch to text mode sudo systemctl isolate graphical.target # Switch to GUI mode
This will immediately switch the system to the specified target without requiring a reboot. However, the changes will not be persisted across reboots. To make the changes permanent, you will need to use the set-default
command as described above.