How to change the default runlevel on Ubuntu


 On Redhat you would simply look for the file /etc/inittab and locate the line that says:

# The default runlevel.
id:3:initdefault:

Simply replace the 3 with 2 or 4 or 5 depending what you wanna do in order to change the default runlevel.

On Ubuntu starting from some version around 6sh… whatever, no one is running that anymore anyway and those who do run it don’t need to change that. At the time I am writing this the current LTS is 10.04 and the current testing release is 10.10
So here is how to do it.

Go to the directory /etc/init and open the file rc-sysinit.conf. find the following line and modify.

 

# Default runlevel, this may be overriden on the kernel command-line
# or by faking an old /etc/inittab entry
env DEFAULT_RUNLEVEL=2

This is the default runlevel where the system will go during the bootup process. So you will need to reboot for this take effect, so to speak.

Now if you want to play a joke on a colleague, set the default runlevel to 6 and watch.

 


Leave a Reply

Your email address will not be published.