How can you permanently change the default runlevel across reboots?

Explore the Linux Fundamentals Test. Revise with flashcards and multiple choice questions, each with hints and explanations. Prepare thoroughly for your Linux exam!

To permanently change the default runlevel across reboots, using the systemctl set-default command is the correct approach on systems that utilize systemd. This command allows you to specify which target (equivalent to runlevel in older systems) should be the default when the system starts.

When you execute systemctl set-default <target>, it creates a symbolic link in the /etc/systemd/system/default.target directory pointing to the desired target. This instruction ensures that every time the system boots, it transitions to the specified target, achieving the desired state automatically.

In contrast, editing the /etc/systemd/system file directly without the proper context does not guarantee that the settings will be applied as intended, as this directory is meant for service definitions rather than default setup changes. Modifying the /etc/inittab file would be relevant in systems that predate systemd, but many modern distributions have transitioned to systemd, which does not use this file. Lastly, changing the bootloader configuration typically impacts which kernel and parameters are used at boot time rather than setting runlevel or target behavior for the entire system after startup.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy