Gentoo Linux is a mysterious distribution for me. I remember testing it with a school friend many years ago (you know the free CD with a Linux magazine)
It took the whole evening to install it, displaying strange command lines on the screen for a few hours (but we succeeded!)
I never really used it after that, and I was a bit skeptical to install it on Raspberry Pi knowing that. But let’s see how it works!
How to install Gentoo Linux on Raspberry Pi?
Gentoo Linux is different from the other main Linux distribution because it must be compiled from sources, to fit each computer specifications.
As Raspberry Pi are all the same (for a specific model), it is possible to save time by installing a pre-built image.
In this complete tutorial, I will start with a few details about Gentoo, then I will show you how to install it easily on Raspberry Pi 3 or 4, and finally I’ll guide you through the first steps to start using it
What is Gentoo Linux?
Let’s start with the presentation from the official website:
Gentoo is a free operating system based on Linux that can be automatically optimized and customized for just about any application or need.Gentoo.org
Extreme configurability, performance, and a top-notch user and developer community are all hallmarks of the Gentoo experience.
Yes… they really love their system 🙂
Gentoo Linux had its first release in 2000 and is still updated regularly since that time
In fact, they are working with weekly releases now, so you always download the latest up-to-date software available
What’s the difference with other Linux systems?
Most Linux distribution release pre-built images with each new major version, and then pre-built packages to install new things or update them.
On Ubuntu for example, there is a major update twice a year, with a new version. Then you use apt to manage the packages.
With Gentoo, you directly download the source code, and then compile it. There is no versioning concept, no pre-built packages.
They describe this operating mode as being more optimized and customizable
But you can also see this as a problem if you don’t have a solid reason to compile everything
In addition, it’s possible to download a minimal ISO image for computers (AMD64 architecture), you can use it to save a little time
And I’ll show you in the installation part where to find it for Raspberry Pi
What are the Gentoo pros and cons?
Before moving to the installation part, let’s do a quick recap about what you can expect by using Gentoo in general:
|Up-to-date software||Time to install it|
|More control||Software management in general|
|Better performance||Difficult to get started|
|Optimized for your system|
Once the installation completed (with the standard method), the main problem I think is the time to install any new software. As there is no packages available, you need to compile each one separately (and its dependencies)
Besides that, Gentoo is a serious operating system, that works very well and that you can consider in some cases (mainly for a server, I think)
Note: don’t stress too much about installing software. It just takes more time but it’s not that different or complex. There is a tool named Portage that handle everything. On desktop, you can even use a graphic interface to find and install new software. More details about this at the end of this tutorial
I hope I did not discourage you and that you are still with me 🙂
The test is worth it even if you don’t keep it on the long term, so let’s try to install it now!
Download a Gentoo image
On the Gentoo official website, you can find archives for all architectures, including ARM (download page here), but it’s only the source files, you can’t install it directly with Etcher
The procedure to use this is pretty intimidating (you can check it here)
The shortcut I recommend today, is to use a pre-built image, made for your Raspberry Pi model
Thanks to someone on GitHub (sakaki-), you can find them on this page
You’ll not get the latest version of each software, but you’ll have a recent version (3 months old during writing) with useful software already installed
And so, you’ll save much time with a quick installation. And then you can just update it to download the latest versions of each software.
Two versions are available : Full (XFCE) or Lite (command line only)
I recommend starting with the Full version if it’s your first test with Gentoo
The full version includes XFCE 4, LibreOffice, Firefox & Chromium, VLC, Kodi, etc.
Create your SD card
Once you have downloaded this file, the installation is almost the same as with any other system :
- If needed, download and install Etcher
It’s a free software that works really well to flash your new SD cards
- Insert your SD card in your computer
- Start Etcher, a window like this will show up:
Click on “Select Image” and find the downloaded file (you don’t need to extract files, you can use the archive directly)
Select your SD card (automatic in general)
Then click “Flash!” to start the copy
- As there are probably more files needed for this system, the copy process takes longer than with Raspberry Pi OS or other systems (almost 20 minutes in my case)
Once done, insert your SD card in your Raspberry Pi and start it!
Just wait for the system to start completely
This also takes a bit longer than usual, but you have nothing to do for now
Once completed, XFCE will start and you can use it directly
A tool is open with the Raspberry Pi configuration
If you have any change to make you can start with that here, then move to the next part for the first configuration steps
First steps on Gentoo Linux
RPI Configuration tool
The goal of this tool is to configure the basic options specific to a Raspberry Pi
Something like raspi-config if you want, but with fewer options
For example, you can configure the Wi-Fi country, the HDMI options and enable or disable some interfaces (like the camera or SPI/I2C)
An overclocking tab is also available if you want to try it
Basically, I didn’t change anything here except for the Wi-Fi country
Any modification requires a reboot to apply changes
My Ethernet card was recognized directly, so if you have a DHCP on your network it will work on first boot without doing anything.
If you need a Wi-Fi connection, it’s easy to set up too
Click on the network icon on the top-right of the screen, and choose your SSID
Enter your password and confirm the connection
No problem for me at this point
Once connected, you can find your IP address with ifconfig in a terminal, or with a right click on the network icon > Connection information
Before going further, I recommend to start by a general update
As I told you, the image is 3 months old in my case, and as we any Linux system, it’s a good practice to start with updating everything
To do this, you don’t need any command line
This image already includes “Porthole” which is a Portage interface (Portage is the package manager on Gentoo)
It’s the same thing as Synaptic, or the “Add / Remove software tool” on Raspberry Pi OS if you want.
- Open the main menu (Applications)
- Go to System and open the “Porthole Portage Frontend”
Ignore the permissions error
- The window looks like this:
On the left you have a menu with all the categories and subcategories
On the right a list of packages available in the selected category
And on the bottom, some information about the selected software
- So, you’ll use this to install new applications
But first, you need to sync with the servers
As on most distributions, there is a repository with the list of packages available (and versions).
- Go to the Actions menu and choose “Sync tree” to update everything (or CTRL+Y)
It may require a few minutes to do this
This depends on many things like your Internet connection, your SD card and your Raspberry Pi model
Just wait for the process to complete
Upgrade the packages
Once the sync completed, you can now upgrade all the packages already installed
You can do this at the same place, in the Porthole application:
- Click on Upgrade in the shortcuts
- The Porthole terminal shows up to let you see the progress
- Once again, it can take a long time to complete
Take a break, we’ll continue just after 🙂
You can also filter the packages list to view only “Upgradable packages”
Then select the ones you want to upgrade, and click “Upgrade”
But for the first time, I recommend updating everything
You can note the commands displayed in the Porthole terminal
If you want to do this later in a terminal or with SSH, the “emerge” command is the one you need to use
All the options are explained in the documentation here if you are interested (don’t forget to add sudo)
SSH / VNC
SSH is already enabled by default, so you can connect directly to your Raspberry Pi (more details here)
VNC is also enabled by default, but you need to set a password to access it:
- Open a terminal
- Type the following command:
- Choose a password
- Once done, connect to the IP address from your computer
Don’t forget to add the screen ID
For example: 192.168.222.31:1
- Enter the password you just set, and you can now manage your Raspberry Pi from your computer
For more details, check my tutorial about VNC here
I also tested XRDP, but you need to install it first (with Porthole)
If you need it for any reason (SSH for example), this image comes with two default users:
- Normal account: demouser / raspberrypi64
- Administrator access: root / raspberrypi64
Don’t forget to change the password
Check this tutorial on how to create a new user (it’s the same thing as on Raspbian)
I think these tips should be enough for a first try
If you are using the full version, everything is simple with XFCE
You just need to understand how the package manager works
After that it’s similar to many other distributions
Most apps are already there, so you probably don’t need much more
And as I told you at the beginning, the Gentoo community is excellent, you’ll easily find some help on the official website
Here are a few links:
- Gentoo official website
- Gentoo documentation
- Gentoo FAQ
- Gentoo Forums
- And for Raspberry Pi related questions, you can also check the GitHub Wiki for the image I recommended
And obviously, if you are still stuck after that, feel free to leave a comment below, maybe someone can help you
I recorded a video simultaneously, so you can watch it on my YouTube channel to have a first look at it before installation:
You can subscribe here if you want to get new videos directly in your YouTube feed (and I would really like that ^^)
That’s it for this complete guide on how to install and use Gentoo on Raspberry Pi
It’s an interesting system, not so complicated in fact
I’m just not sure in which case it will be a good choice to use it over the other alternatives
If you liked this post, thanks to share it on your favorite social network!