30

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

  • 5
    Why do you think moodle requires Ubuntu Server specifically? Can you link to the instructions you are following? You can install a full LAMP stack just as easily on the Desktop version. – steeldriver Aug 14 '14 at 20:58
  • Here's the doc; it talks about Ubuntu Server 14.04 Lts only, so that's why I'm not pretty sure about installing it on Desktop https://docs.moodle.org/26/en/Step-by-step_Installation_Guide_for_Ubuntu#Step_1:_Install_Ubuntu_14.04LTS – José Del Valle Aug 14 '14 at 21:03
  • the assumption made to solve the problem here is wrong, read below why – tomodachi Feb 16 '15 at 16:51
  • 2
    You could have left out the line that explains why you want to do this (e.g. moodle), to keep the question generic. After all, moodle is not mentioned in the title nor the tags. – Serrano Pereira Oct 17 '15 at 14:13

3 Answers3

31

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
muru
  • 197,895
  • 55
  • 485
  • 740
nityan
  • 411
  • 2
    On Ubuntu 15.10 I had to reinstall tasksel after removing the desktop image. Also, the server images don't need to be installed (and can't be) because "Since 12.04, there is no difference in kernel between Ubuntu Desktop and Ubuntu Server" (http://bit.ly/1S54S2d). – D Schlachter Jan 20 '16 at 20:34
  • Can I use this process (with little adjustment) to reduce Linux Mint 17 to minimal installation and convert it to Ubuntu 14.04? I want to do this because if I can, it saves me some trouble of fresh installation and reconfiguration of many packages. – biocyberman Feb 23 '16 at 23:01
  • with ubuntu 16.04 this leaves me with an unusable system, no grub, no kernel, ... any ideas? – x29a Sep 22 '16 at 18:48
  • I think you should reorder those, and remove ubuntu-desktop just before purging lightdm/gdm3, otherwise removing ubuntu-desktop will remove anything you have installed that depends on the linux kernel. – miigotu May 01 '18 at 06:00
4

The simple answer is yes, but running the commands you are able to install Ubuntu server. Ensure that you make the following changes to the grub configuration file located at /etc/default/grub:

GRUB_TIMEOUT=10
( Comment out ‘GRUB_HIDDEN_TIMEOUT’ )
GRUB_CMDLINE_LINUX_DEFAULT=”"
GRUB_TERMINAL=console ( only for PC )

Then you can run

sudo update-grub
heemayl
  • 91,753
2

The assumption that you need to uninstall your Ubuntu desktop and install Ubuntu server is faulty.

However for a real installation its always better to have a minimal installation containing only what you need.

Ubuntu server is just a minimal Ubuntu install with a specific kernel optimized for serving many clients. Instead of a single user in the case of a desktop. any application / Service you can run on your Ubuntu server you can run on Ubuntu desktop

Checking the installation requirements on moodle

We can see that what is needed is:

  • a webserver
  • php support for the webserver
  • a database
tomodachi
  • 14,832
  • 2
    Sometimes it's desirable to do this, especially if it's a production server, and the person who originally set it up did so as a desktop out of ignorance. There's no need to run Unity on a production server, and reinstalling the whole server seems like overkill. – m0j0 Aug 05 '15 at 16:48
  • In production, I'd rather go back to scratch and reinstall the whole thing if it had been faulty installed as a desktop. Otherwise, I'm thinking GRUB-hell would be a real risk... In any other case, yes, it's likely not at all going to be an issue if it's originally a desktop installation... – Erk Aug 24 '18 at 15:35