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. But let’s see how it works!
The fastest way to install Gentoo on Raspberry Pi is to download a pre-built image and flash it on an SD card with a tool like Balena Etcher.
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 easily install it 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.
In fact, they are working with weekly releases now, so you can always download the latest software available.
Difference between Gentoo and other operating systems
Most Linux distributions release pre-built images with each new major version, and then pre-built packages to install new things or update them. With Gentoo, you directly download the source code, and then compile it. There is no versioning concept, no pre-built packages.
On Ubuntu for example, there is a major update twice a year, with a new version. Then you use apt to manage the packages. That’s not the case with Gentoo.
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), so you can use it to save a little time.
In the installation part, I’ll show you 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 of 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 is complete (with the standard method), I think the main problem is the time it takes to install new software. As there are 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 which you can consider in some cases (mainly for a server, I think).
Note: don’t stress too much about installing software. It 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. I’ll provide more details about this at the end of the tutorial.
Gentoo installation on Raspberry Pi
I hope I didn’t discourage you and that you are still with me :).
The test is worth it even if you don’t keep it for the long term, so let’s try to install it now!
Download the Gentoo image for Raspberry Pi
On the Gentoo official website, you can find archives for all architectures, including ARM (download page here), but it’s only the source files, and 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 won’t 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! 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.
Flash Gentoo on a 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!
First boot with Gentoo
Just wait for the system to start completely.
This also takes a bit longer than usual, but there isn’t anything you can do.
Once completed, XFCE will start and you can use it directly.
A tool is open with the Raspberry Pi configuration.
If you have any changes to make you can start with that here. Then you can 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, or Serial Peripheral Interface, is a synchronous communication protocol that enables data exchange between.../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 immediately, 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 also easy to set up.
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 starting with a general update.
As I told you, the image is 3 months old in my case, and as with any Linux system, it’s a good practice to start with updating everything.
To do this, you don’t need to use a 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.
It depends on many things, such as your Internet connection, your SD card and your Raspberry Pi model.
Just wait for the process to complete.
Upgrade the packages
Once the sync is complete, you can 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 will show up to let you see the progress.
- Once again, it can take a long time to complete.
Take a break, we’ll continue after it finishes :).
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, or Secure Shell Protocol, is a cryptographic network protocol used for securely accessing and..., the “emerge” command is the one you will 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 it 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 will need to install it first (with Porthole).
I have a full tutorial about XRDP on Raspberry Pi here if you don’t know what I’m talking about.
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 your 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 won’t need much more.
And as I mentioned at the beginning of the article, the Gentoo community is excellent, so 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 in the community, maybe someone can help you out.
Want to chat with other Raspberry Pi enthusiasts? Join the community, share your current projects and ask for help directly in the forums.
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!