Skip to content

Instantly share code, notes, and snippets.

@kmpm
Last active March 23, 2024 19:31
Show Gist options
  • Star 58 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save kmpm/8e535a12a45a32f6d36cf26c7c6cef51 to your computer and use it in GitHub Desktop.
Save kmpm/8e535a12a45a32f6d36cf26c7c6cef51 to your computer and use it in GitHub Desktop.
Adding PIXEL to Raspbian Lite

Adding PIXEL/GUI to Raspbian Lite

These 'notes' were primarily intended for my own consumption but since there have been surprisingly many comments to it over the years I wanted to do some updates and clarifications. Thanks for all comments.

These instructions will require you to have connection to internet from your pi, WiFi, Ethernet or by some other means like a 3G USB dongle or something.

Preparations

Download and flash Raspbian Lite as normal. Run raspi-config and setup whatever you would to for console only mode. I usually change password, hostname and activate SSH server as a initial setup.

Adding wifi from console (optional)

This can be done in at least 2 ways and I would recommend using raspi-config but you could also...

Edit wpa_supplicant manually

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf Add the bottom of the file

network={
  ssid="YOUR_SSID"
  psk="YOUR_PASSWORD"
}

Save and reboot

Touchscreen

If you have any other that the original Raspberry Pi touchscreen you might have to install the correct drivers.

Rotate Touchscreen (optional)

These instructions are for the original Raspberry Pi touchscreen and if you have to change it's rotation, wich you might have to do depending on the case you mount it in.

  • Edit /boot/config.txt on the newly flashed card and add the line lcd_rotate=2 at a location of your choice in the file.
  • Save and reboot

Run all updates

Reduces that anything goes wrong int the following steps

sudo apt update
sudo apt upgrade

# you only have to reboot if there were any updates that needed it
# if unsure do it anyway
sudo reboot

Adding GUI

This will get you a really stripped down PIXEL installation Tested on Jessi and Stretch

sudo apt-get install -y raspberrypi-ui-mods rpi-chromium-mods
sudo reboot

This will pull in all packages needed for GUI + rpi modified Chromium web browser and is all you need for a "basic" setup. It will take some time though. The download will go fast but decompressing and installing is tough even on a Rpi 3.

I will do some tests but you might have to install lightdm manually using sudo apt-get install lightdm as well. It should be a part of the installation of raspberry-ui-mods though.

There might be some issues with icons being installed for programs that isn't installed and when new programs not showing up in the menu. This is probably due to some missing package that I yet have to figure out which one.

Enable autologin (optional)

If you want autologin you have to run raspi-config again and select "Boot option"->"Desktop / CLI"->"Desktop autologin"

Xinit (optional)

If you do not want autologin but want to be able to start the gui manually sudo apt-get install --no-install-recommends xinit so that you can boot to the console start the desktop as required using the command startx.

@texadactyl
Copy link

Excellent write-up. Thank you.

@texadactyl
Copy link

Note that lightdm comes in automatically in Raspbian Stretch package raspberrypi-ui-mods.

@hhojatansari
Copy link

Thanks a lot.

@ELepolt
Copy link

ELepolt commented Jun 16, 2020

After using raspi-config to set it to boot to 'desktop autologin' I am simply getting a black screen. It may be worth noting that I'm using an attached touchscreen and not an HDMI cable.

EDIT: I ran the proper program from here, https://github.com/goodtft/LCD-show and when I rebooted after that it was good to go

@EricFromParis
Copy link

EricFromParis commented May 12, 2021

I did all that, and everytime it says no-change (was already in) and yet, startx doesn't start .... :(
RBPi 4b fresh install

@EricFromParis
Copy link

THe main arror message I have is : Cannot open /dev/tty0 (Permission denied)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment