Ubuntu – convert Ubuntu Desktop 14.04 to Server

14.04server

I've found several solutions to convert Ubuntu 12.04 Desktop to Server, with the following commands:

sudo apt-get install tasksel
sudo tasksel remove ubuntu-desktop
sudo tasksel install server
apt-get install linux-server linux-image-server
apt-get –purge remove lightdm

I just want to know if it is the same process with Ubuntu 14.04. The reason I need to do this is because I need to install moodle (some people may have other reasons to do this so I hope this helps them too) and it requires to run over Ubuntu Server rather than Desktop.
Thanks

Best Answer

NOTE: the following commands are good only to Ubuntu version less/older than 12.04, see Server FAQ, CAUTION: you might end up with a useless system.

Thanks for your answer but I've found you need to add the update line

sudo apt-get update

Also corrected the following line

sudo apt-get -purge remove lightdm

To

sudo apt-get purge lightdm

The full version of the corrected script is below

# update
sudo apt-get update

# install the 'tasksel' package so we can remove the desktop image       
sudo apt-get install tasksel

# remove the desktop image
sudo tasksel remove ubuntu-desktop

# tell tasksel to start the server image setup
sudo tasksel install server

# install the server images
sudo apt-get install linux-server linux-image-server

# remove lightdm
sudo apt-get purge lightdm

# remove all packages no longer required (~400 MB)
sudo apt-get autoremove
Related Question