Tuesday, April 25, 2017

Convert Ubuntu Desktop to Server

# 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

5 comments:

  1. VERY IMPORTANT: It is possible these operations can't be performed remotely on a headless server. Step 2 deletes important packages, including OpenVPN. On the machine I used the command, sshd was bound only to the OpenVPN interface, and now I have to go across town to continue :)

    ReplyDelete
    Replies
    1. Serial console is your friend. It's ok, I haven't set it up yet, either ;-)

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Reading state information... Done
    E: Unable to locate package linux-server
    E: Unable to locate package linux-image-server


    help pleas

    ReplyDelete