On Redhat you would simply look for the file /etc/inittab and locate the line that says:
# The default runlevel.
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.