Ubuntu Desktop Comes to Raspberry Pi 4 2GB Owners
The lower spec Raspberry Pi 4 2GB is now a viable platform for Canonical's popular Ubuntu distro thanks to the addition of zswap.
Owners of Raspberry Pi 4s with 2GB of RAM, until now green-eyed and furious with envy at 4-8GB owners running full desktop Ubuntu, can now join Canonical’s party. The trick, as reported by OMG Ubuntu based on an Ubuntu Blog post, is in the compression.
Like many operating systems, Ubuntu uses a swapfile on a computer’s storage system to hold data that won’t fit in RAM. In the case of the Pi, this is often a Micro SD card, not noted as the speediest medium in terms of either read or write performance, unless you buy the best micro SD cards. Enter zswap, a compression tool that intercepts processes about to be sent to the swapfile, and compresses them. Chances are that the newly crunched data can stay in RAM, and it’s much quicker to decompress it than fetch data from the SD card. This trick can even improve performance on 4GB and 8GB Pi boards, including the Pi 400 all-in-one.
The best news is that zswap is already in Ubuntu, there's no need to wait for another release (although it will be enabled by default in 22.04, which should release in April), and a simple one line Bash command is all you need to enable it now.
Stay On the Cutting Edge: Get the Tom's Hardware Newsletter
Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.
Ian Evenden is a UK-based news writer for Tom’s Hardware US. He’ll write about anything, but stories about Raspberry Pi and DIY robots seem to find their way to him.