7

It turns out that when I prepared a certain Raspberry Pi several months ago, I used the full Raspbian image. Since then, that Pi is on headless duty just running some server software. When I run updates on it, a whole lot of stuff I'll never use gets updated. Migrating from jessie to stretch took unnecessary hours.

What can I do to move to the lite version from within the existing installation?

I would presume that I can remove some package and install another, like the ubuntu-desktop on Ubuntu, but what would that be on Raspbian?

Colin Dean
  • 245
  • 3
  • 6

2 Answers2

8

I don't like answers that simply say install a clean image as if the OP wasn't aware of that possibility and it also disregards the work that the OP has already done on their installation.

So to answer your question directly, here's how to remove the GUI:

sudo apt-get remove --purge x11-common
sudo apt-get autoremove

The first line invalidates a lot of packages that are then removed by the second line leaving a much reduced codebase although it will not be identical to a Lite installation.

You can also use the tasksel command to remove top-level tasks which will consist of a number of packages.

John Hawthorne
  • 914
  • 5
  • 12
1

What can I do to shift to the lite version?

There is no reliable and user-friendly way to "shift" from an already installed "Raspbian Stretch with desktop" to "Raspbian Stretch Lite".

In theory you need to find all different packages and replace respectively remove them. But in practice this is very time-consuming.

To get the lite version the most sensible way is to install the correct image.

Addition:

Removing the GUI will not transform an installation of "Raspbian Stretch with desktop" into "Raspbian Stretch Lite". There are a lot more differences between both versions. For further details about the differences please see:

Fabian
  • 1,288
  • 1
  • 10
  • 19