19

I've used my raspberry pi for about 2 years now and in the beginning I removed the X server as I thought I'd never use it. (I followed the tips here to remove How to uninstall X Server and Desktop Manager when running as headless server?).

Now I want to be able to run X server and have graphics.

I've been entertaining the idea of wiping the SD card and just doing a new installation with X already working but I've configured the Raspbian I have now quite extensively and I don't want to do it again.

My preferred method would be to just install X and get it working again into the Raspbian I already have there. Is it possible? How would I go about doing that?

Whettingstone
  • 293
  • 1
  • 2
  • 6

2 Answers2

25

Linux uses a heterogeneous GUI stack, meaning it's arranged in layers but there's different layers you can arrange.

The bottom of the stack is relatively homogeneous, meaning it's almost always the same. This is the Xorg server joan has indicated.

However, while X all by itself does provide you with a graphical desktop, it doesn't look like much -- plain black screen with a cursor. This makes just launching applications difficult, since there are no menus or taskbars either. You can configure a terminal to launch at start up and go from there, but realistically, additional software is needed.

This is where the next two layers, the window manager (WM) and desktop environment (DE) come in. The latter requires the former but not vice versa. There are stand-alone WM's that have most of the features associated with a graphical desktop, but linux distros usually use a more minimal WM with a heftier DE on top.

The default DE on Raspbian was (keep reading) lxde. If you want that back, I imagine apt install lxde should do it. There may be more pieces needed in the end -- you can see a list of possibilities with apt-cache search lxde. The other common linux DE's are also available, but most of them consume more resources which is why lxde was chosen as the default on the pi.

Note that this does not include a graphical login, which is the task of a display manager (DM). The default on raspbian is lightdm, which you can install with apt-get install lightdm.

To sum up the two parts you'd need to get the original GUI system back would be:

  • apt install lxde lxde-core lxterminal lxappearance
  • apt install lightdm

These should drag in X and other dependencies if they are not there already. If you wish to start X from the command line using startx or xinit, you'll need:

  • apt install xinit

The new default DE is the Pi Foundation's tweaked branch of LXDE, PIXEL. Apparently you can install that with:

apt install raspberrypi-ui-mods

This may or may not include a display manager for GUI logins.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
2

Try

sudo apt-get install xutils

That should drag in all the packages you need.

Then perhaps use

sudo raspi-config

and select the option to boot to desktop.

joan
  • 71,852
  • 5
  • 76
  • 108