• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Change runlevels/targets using systemd in Ubuntu

by admin

Ubuntu can be booted into one of several target levels. The default target to which the system is configured to boot will, in turn, dictate which systemd units are started. The targets that relate specifically to system startup and shutdown can be summarized as follows:

  • poweroff.target – This is the target in which the system shuts down. For obvious reasons it is unlikely you would want this as your default target.
  • rescue.target – Causes the system to start up in a single user mode under which only the root user can log in. In this mode the system does not start any networking, graphical user interface or multi-user services. This run level is ideal for system administrators to perform system maintenance or repair activities.
  • multi-user.target – Boots the system into a multi-user mode with text based console login capability.
  • graphical.target – Boots the system 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 – Reboots the system. Another target that, for obvious reasons, you are unlikely to want as your default.

Changing runlevels/targets

1. To set a default runlevel/target in systemd, use the following syntax:

# systemctl set-default [desired].target

2. If the server is in rescue mode or in a chrooted environment, the default target can be set with the following command syntax:

# ln -sf /lib/systemd/system/[desired].target /etc/systemd/system/default.target

3. To change runlevels on the fly:

# systemctl isolate [multi-user.target | graphical.target]

Filed Under: Linux, Ubuntu

Some more articles you might also be interested in …

  1. light Command Examples in Linux
  2. CentOS / RHEL : How to install a specific version of rpm package using YUM
  3. sftp Command Examples in Linux
  4. nmtui Command Examples in Linux
  5. Mac Terminal diskutil Command Examples
  6. Is there a CSS parent selector
  7. cpulimit Command Examples in Linux
  8. arp Command Examples in Linux
  9. View files using – cat, more, tail, head and wc commands
  10. wg Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright