How to Set the default runlevel In Linux


Procedure Set the default runlevel In Linux CentOS Fedora Redhat Ubuntu Debian Linux

Set the default runlevel

1) To set the default run level, you have to delete the existing symbolic link and create a new one. This will be permanent after rebooting also.

#rm /etc/systemd/system/default.target

Default Text mode ( runlevel 3)
#ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

Default Graphic Mode ( Runlevel 5)
#ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

2) To switch form one run level to other immediately you have to run the following comment.

Switch to Text Mode (Runlevel 3)
#systemctl isolate multi-user.target
or
#systemctl isolate runlevel3.target

Switch to Graphical Mode (Runlevel 5)
#systemctl isolate graphical.target
or
#systemctl isolate runlevel5.target