In this article, we will show you how to change runlevel on Ubuntu and LinuxMint. We will also explain the different systemd targets and what they do.
Ubuntu Systemd Targets
Ubuntu can be booted into one of several systemd targets. The default target to which the system is configured to boot will dictate which systemd units are started. The targets that relate specifically to system startup and shutdown are.
- poweroff.target – The system shuts down.
- rescue.target – The system boots into a single-user mode under which only the root user can log in. No networking, graphical user interface, or multi-user services are started. This run level is ideal for system administrators to perform system maintenance or repair activities.
- multi-user.target – The system boots into a multi-user mode with text-based console login capability.
- graphical.target – The system boots into a networked, multi-user state with X Window System capability. By default, the graphical desktop environment will start at the end of the boot process. This is the most common run level for desktop or workstation use.
- reboot.target – The system reboots.
How to check current runlevels on Ubuntu / Linux Mint
When the system boots, systemd activates the default.target unit by default. This unit’s main function is to activate other units and services by pulling them in based on their dependencies.
To view the default target, type the following command:
➜ ~ systemctl get-default multi-user.target ➜ ~
Change Runlevel on Ubuntu
To change the default runlevel you can use the below syntax
systemctl set-default <desired>.target
To change runlevels on the fly, use the following command:
systemctl isolate [multi-user.target | graphical.target]
To set the default runlevel to graphical.target, you would use the following command:
systemctl set-default graphical.target
To change the runlevel to multi-user.target while the system is running, you would use the following command:
systemctl isolate multi-user.target
The systemd targets provide a flexible way to control how Ubuntu boots.
By understanding the different targets and how to change them, you can customize the boot process to meet your specific needs.
From this tutorial, you have learned how to change runlevel on Ubuntu and Linux Mint.
Do let us know your comments and feedback in the comments section below.
If my articles on TipsonUNIX have helped you, kindly consider buying me a coffee as a token of appreciation
Thank You for your support!!