Raspberry Pi OS Lite - Install and configure with LXDE

By peter, 9 January, 2025

We want to use Raspberry Pi OS Lite download with the LXDE graphical user interface on a Raspberry Pi Zero or Zero 2. We like the reduced memory usage compared to a full install of Raspberry Pi OS.

(This article was originally published in 2016 as Raspbian Lite - Install and configure with LXDE. The original described Raspbian Lite and now describes the Raspberry Pi OS Lite.)

Raspberry Pi OS Lite uses the same Debian Linux base as Raspberry Pi OS Desktop. The Lite version has no graphical user interface and none of the applications. Raspberry Pi OS Lite uses only 2.8 gigabytes on disk instead of the 6 gigabytes swallowed by the Desktop version.

You load Raspberry Pi OS Lite onto a microSD card. An 8 gigabyte card is enough. 16 is recommended for expansion. Buy a fast card because the card is the system disk. The Pi 4 can use A1 speed and the Pi 5 can use A2 speed.

The Pi Zero and Zero W are 32 bit machines so are limited to the 32 bit download. The Pi Zero 2 is 64 bit, ARMv8, and uses the regular 64 bit OS. I have only the Pi Zero 2 so use 64 bit everywhere.

Image on microSD

The Raspberry Pi OS Lite image file expands out to two partitions on the microSD card. There is an unallocated space of 4.3 MB left for a potential future use. Partition 1 is a 537 MB FAT boot partition named bootfs. Partition 2 is a 2.2 GB Ext4 partition named rootfs.

Install

Insert the microSD card in the Raspberry Pi then start the device. Raspberry Pi OS will start, run through some Linux command line stuff, then display the following.

Debian GNU/Linux 12 raspberrypi tty1
My IP address is 127.0.1.1 ::ffff:127.0.1.1 raspberrypi login:

Enter your user id and your password.

Enter the following command to open the Raspberry Pi Software Configuration Tool.

sudo raspi-config

Select Expand Filesystem to expand Raspberry Pi OS across the whole microSD card. You will see some command line stuff rush past then a message about the resize happening on the next reboot.

Select Boot Options to change the login at boot time. Select Console Autologin to automatically log you in as pi, saving you a couple of seconds.

Select Internationalisation Options to fix up the country and keyboard settings. Change the locale, timezone, keyboard layout, and Wifi country. You have to select the Internationalisation four times to set the four options.

Select Finish then Yes to reboot.

Connect the Wifi

2.4 GHz

Make sure your WiFi hotspot is running at 2.4 GHz as the Pi Zero W and Zero 2 W have only 2.4 GHz. For 5 GHz connection, you need a Pi 4 or 5.

There is more detail about this step in www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md.

You can use raspi-config to set the country then connect to a WiFi hotspot or network so long as you know the SSID and passphrase. raspi-config will not list available networks.

Enter the following command to check your Zero 2 W WiFi is on.

nmcli radio wifi

Enter the following command to find your local Wifi networks.

nmcli dev wifi list

Look at the names, the SSIDs, then enter the following command to select the network. Replace example_ssid with your network name. you will be asked for the network password.

sudo nmcli --ask dev wifi connect example_ssid

If the SSIDcontains a space, add double quotes like the following example.

sudo nmcli --ask dev wifi connect "Example SSID"

Back at the command line, enter sudo reboot to restart the system and test the wireless configuration will work when you boot up the machine.

Update the current software

Enter the following command to update the operating system's list of available packages. The update downloads several megabytes.

sudo apt update

You will see errors if the Wifi has not connected.

Enter the following command to install updates. My machine downloaded 97 megabytes. The increase in disk space was 121 megabytes. This will vary based on the time between the OS image creation and your install.

sudo apt full-upgrade

You can also enter the following command to remove obsolete items. You normally do this only after a major upgrade when packages are replaced by something different.

sudo apt clean

Install LXDE

LXDE is the light weight graphical user interface installed in the full version of Raspberry Pi OS. We will install it here without all the extras, the games and other stuff we do not need.

LXDE is built on Xorg. Enter the following command to install Xorg. The download is 26.1 megabytes and it uses 72 megabytes on disk.

sudo apt-get install xserver-xorg

The install takes a couple of minutes, long enough to put the kettle on for a cup of tea or coffee.

Enter the following command to install an Xorg command line start option. You may never need this but the download is only 2.6 megabytes and it uses only 6.4 megabytes on disk.

sudo apt-get install xinit

Enter the following command to install LXDE. This is the big bit. The download is 71 megabytes and it uses 242 megabytes on disk.

sudo apt-get install lxde-core lxterminal lxappearance

You now have time to use the boiled water to make and drink that coffee.

Enter the following command to install the LightDM login manager. LightDM was already installed by a previous step when I tested this on the most recent Raspberry Pi OS.

sudo apt-get install lightdm

You can now start raspi-config again, sudo raspi-config, select Boot Options, then select Desktop Autologin.

Reboot.

You now have the Debian Raspberry Pi OS LXDE desktop.

Cleanup

Change the desktop background to something bland, a plain light colour.

Preferences

Select the menu icon then Preferences.

Under Preferences, there is a "Customise Look and Feel" application. I did not find anything worth changing. You might prefer a different theme on your screen.

"Default Applications for LXSession" might be worth changing if you install new applications to replace current applications.

Package Management

There is no package manager installed, no Synaptic Package Manager. You could enter the following command to install the Synaptic Package Manager. The Synaptic Package Manager might be fixed by the time you read this. The download would be 4.5 megabytes and it would use 18 megabytes on disk.

sudo apt install synaptic

Network management

Network Manager is already installed in the latest Raspberry Pi OS. Before you install a GUI, you can use nmcli to configure Network Manager. After you install a GUI, there is a graphical option but it is nowhere near as comprehensive as nmcli.

Resource usage

The highest memory usage on my Raspberry Pi 3 B was 110 megabytes and the highest CPU usage was 24%. 24% is one core out of 4 and may be the limit for applications that cannot use multiple cores. The Pi Zero 2 has plenty of CPU power but limited memory, a situation where you benefit from starting with the minimum and adding only what you want.

If you start with the Desktop download, you can start it without the desktop and end up with something close to what you achieve from using Lite then adding LXDE. The difference is not important when you have a GB or more of memory. In the 0.5 GB of the Pi Zero memory, every little bit counts.

In my experiments with stripping down the Desktop version, the result is excellent and it is almost as much work as building up from Lite through LXDE. There are lots of suggestions for a lighter Desktop including things like switching off Bluetooth if you are not using it. Switching Bluetooth off still leaves a big speedbump in the boot process. You can remove more overheads by deleting Bluetooth.

You have to find the option to stop a package before it is included in the boot process, before anything is loaded into memory, to get the equivalent of starting without the package. This is often the deletion of the package.

Software installed

Select the menu icon. You have three menu options, System Tools, Preferences, and Run.

Run is just a cut down terminal. Use a terminal window for commands so you can see all the messages and run extra commands to verify the results.

System Tools

File Manager PCManFM

PCManFM 1.2.3 is the file manager installed with LXDE. PCManM has everything you expect from using the Nemo file manager and equivalents.

The search is slightly more complicated and gives you more control of the search. Look in the menu bar, Tools, Find Files. Adding a simple search would help make PCManFM better than Nemo.

LXTerminal

The LXDE terminal window appears to be the same as every terminal window in every version of Linux and Unix.

Root Terminal

This is a broken option. The application asks for the "root" password but there is no password disclosed for root. There is nothing you could do in Root Terminal that you cannot do in the regular Terminal window by using the "sudo" option.

Task Manager

The LXDE task manager is LXTask 0.1.6. LXTask lists the tasks and their resource usage plus a total CPU usage and a total memory usage. There are no fancy charts and no network usage. Network usage is the one other resource item you might want to know.

UXTerm

UXTerm is another terminal window and not as pretty.

XTerm

Xterm appears to be the same as UXTerm. Neither is as useful as LXTerminal.

Preferences

Step through the Preferences options looking at what you can change.

Customise Look and Feel

Open the Customise Look and Feel item in the Preferences menu. Select each tab across the top and browse the options. You might want to change something.

The "Other" tab has the sound effects options. If you switch off the sound effects, your Raspberry Pi should use less electricity. This could make a difference when running on batteries.

Default applications for LXSession

Select the Default applications for LXSession item in Preferences. Select each of the menu items in the left part of the LXSession configuration window and browse the options. You might want to change what is started automatically.

Desktop Preferences

Desktop Preferences lets you change the desktop background colour and other settings. Open the application. Browse each tab. You can reach the same Desktop Preferences by right clicking the desktop.

Desktop Session Settings

Select the menu option. Look at the "Automatically Started Applications" tab then the "Advanced Options" tab. Do you want the network software automatically started? You can change that type of setting in the Desktop Session Settings.

Network Connections

The network icon in the bottom righ corner gives you some options when you select the icon then some more options when you right click the icon. One of the right click options is Edit connections. You can select the same option through Preferences, Network Connections. This is the place where you can create bridges and other fancy options.

Select Add then the drop down arrow in Choose a Connection Type. Read the options. This is the place to create those options. Select Cancel then close the Network Connections window.

Openbox Configuration Manager

Openbox lets you control the theme fo open windows. The default theme is Onyx and is ok on my screen. You might choose something else for a different screen. Note all the other options you can change. You might want to change the docking options or number of desktops.

Resource usage

Raspberry Pi OS Lite with LXDE uses less memory when compared to any version of Linux with the same features and a reasonable GUI. A simple action, resizing a window, uses 25% of the CPU instead of the 50% used by the MATE graphical user interface.

The problem with this minimal install is continually having to add the missing things you need for normal work. If you add the missing bits through terminal then add the command to a simple recreation script, there is less to memorise.

Conclusion

The extra work to set up Raspberry Pi OS Lite with LXDE is worth the effort when your project is headed toward a Raspberry Pi Zero. The Raspberry 1+ is close to a Zero and would benefit from customising the Lite version. A Raspberry Pi 2 is close to a 3 but might benefit from the Lite version of Raspberry Pi OS, depending on the code you want to run on top of Raspberry Pi OS.

For the Raspberry Pi 4 with 1 TB or 2 TB of memory, use the standard Raspberry Pi OS and forget the bloat. Just look at what is started during boot as some those packages may not be needed and can make a little bit of difference when you have less than 4 GB of memory.

Comments