Install Raspberry Pi OS’s desktop environment over a Lite install
Almost every time I set up a Raspberry Pi these days, I use the ‘Lite’ version of Raspberry Pi OS. That version doesn’t come with a GUI, it just boots to the console. It’s much smaller in size and contains most things you’d need for a ‘headless’ Pi setup.
And if you know your way around the command line, it’s not daunting to plug in a monitor, keyboard, and mouse, and explore via the shell if you need to. But every so often, I’ve had a Lite install that I wanted to switch to GUI, but I’m too lazy to pull the Pi out of wherever it’s installed, pull the microSD card, and re-flash it with the full OS, and then re-run my automation on it to set up whatever I had running before.
And that’s why it’s nice to be able to just install the GUI on top of an existing Lite install!
To do that (assuming you’re running the latest Pi OS version, Bullseye as of this writing), just install Xorg and the Raspberry Pi ‘PIXEL’ environment:
sudo apt install xserver-xorg raspberrypi-ui-mods
Then run sudo raspi-config and change the system boot option to boot to desktop, instead of the CLI. Then reboot, and you should be in the graphical environment!
There are other useful bits of software you can install if you want, like chromium-browser (which gives you a web browser), and arandr, which gives you the ‘Screen Configuration’ GUI, and you could even use an alternate desktop environment if you want—check out This raspberrytips.com article for more on that.
Read more: Install Raspberry Pi OS’s desktop environment over a Lite install