I'm currently setting up a home server using a very, very old PC. It has Ubuntu 11.10 installed on it, but it can't actually handle the GUI. I want to install the server edition of Ubuntu, which is command line only, but have no idea how to do so. What can I do?
Actually, if you just have problem with running the GUI there's no need to install another distribution, simply modify the startup sequence to prevent the graphical interface from coming up and work from the command line as you desire.
I don't have access to a system right now, but I believe the script you'll need will be found in the
/boot/grub directory. Perhaps someone here can give you the name of the script before I get home to check.
I just found this: Starting Ubuntu without the GUI
I see three ways to do it:
Changing the default runlevel
You can set it at the beginnign of /etc/init/rc-sysinit.conf replace 2 by 3 and reboot. You can enable the graphical interface with telinit 2.(More about runlevels)
Do not launch the graphical interface service on boot
update-rc.d -f xdm remove
Quick and easy. You can re-enable the graphical interface with service xdm start or revert your changes with update-rc.d -f xdm defaults
apt-get remove --purge x11-common && apt-get autoremove
I think it suits best for a computer considered as a server. You can re-enable the graphical interface by reinstalling the packages
There's also this: Possible to install ubuntu-desktop and then boot to no GUI
The point being, you can prevent the GUI from coming up if that's your main issue.
I think that an easy way is with
tasksel via command line.
Open a terminal and digit:
$ sudo apt-get install tasksel
$ sudo tasksel
It will show a simple gui-cli that lets you to choose what you want by a simple check/uncheck (for eg. uncheck "Ubuntu desktop" and also check "Basic Ubuntu server" and "LAMP server".
There's no difference between a server and desktop distribution , just involving different packages.
The two things you should do was:
- Replace default generic kernel with server kernel , by:
apt-get install -y linux-image-server
Disable or remove all graphical software , xorg-server.
To disable them , disable lightdm for auto start , edit
/etc/init/lightdm.conf, comment all these lines (place a '#' in front of each line)
start on ((filesystem and runlevel [!06] and started dbus and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1 or stopped udev-fallback-graphics)) or runlevel PREVLEVEL=S)
If you uninstall the desktop packages and install the server packages through tasksel, you should be prepared to do a LOT of reconfiguration, as this will remove your network settings, wireless card drivers, etc.
If all you need to do is get rid of the gui, follow steps 1-2 from the first answer. It's up to you whether or not to purge the GUI completely.
I also replaced the generic kernel with the server kernel as noted in the answer @warl0ck and commented out the lines in the lightdm.conf file.
After this, rather than tasksel to add/remove packages, I manually removed packages from the command line. Unless you're going to use the LibreOffice suite, Firefox, etc., you can remove all these packages. The easiest way to get a list of packages is to run:
sudo dpkg --get-selections | grep -v deinstall > ~/packages nano ~/packages
This will output a list of all installed packages to your home folder and open it.
When you uninstall a core package (such as libreoffice-common), it should automatically remove dependent packages.
To uninstall, type
sudo apt-get remove package-name
Once all the uninstalls are done, run the following command to autoremove package listings and dependencies no longer used.
sudo apt-get autoremove
This worked for me turning my desktop installation into a "server."
If the GUI would be useful, you might look into installing xubuntu instead, as it's a much lighter distribution. I didn't particularly care for it, but it's definitely more lightweight.
Disable the GUI from Ubuntu System.
Here I am going to show, how to disable GUI without removing package of lightdm, gdm, compiz unity. You can start it manually.
Please follow the below steps.
Step 1-: Open the "grub" file.
$ sudo nano /etc/default/grub
Step 2-: Replace the line with "text" like below.
Step 3-: Update the grub file using below command-:
$ sudo update-grub
Step 4-: Restart the system.
$ sudo init 6
Addition Step to start GUI session.
$ sudo service lightdm restart