The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (2024)

Finally! What we were all waiting for. The long-awaited Gentoo Linux installation guide, made by me, taking references from Gentoo Handbook. Before I start counting the steps and see if I could deliver on my promise to keep it simple, I want to make a couple of clarifications.

This guide is as simple as possible

I don't mean to teach you how to install the latest NVIDIA driver, or the latest experimental filesystem from some company. I will try to keep everything to the bare minimum, why? simple, so I leave something to you to investigate and learn πŸ˜‰

Installation steps

I am going to summarize in a very simple way the blocks that I am going to work on during this guide. I plan to install Gentoo on a usb to take the screen caps, but you can replicate it on your hard drive and follow the process with me. The steps are the following:

  1. Installation medium.
  2. Prepare discs.
  3. Stage3
  4. make.conf
  5. Chroot
  6. Kernel
  7. Grub
  8. Enjoy πŸ™‚

As you can see, I differ a bit from the handbook, but it is because I prefer to put everything together in the same package to be able to do a cleaner job, but if you need to stop to review other options, do not hesitate to go to the Handbook, there will be all the information they may need.

For this installation I will be using SystemD and GNOME (I will explain the necessary changes for KDE within the GNOME section), but for OpenRC adventurers, they will have to do their homework πŸ˜‰ I choose SystemD so it has been adopted by many other systems and such It may become more familiar to you when configuring certain things as you gain experience with Gentoo. Without further ado, let's start:

Installation medium:

I leave here the link From my previous post on this topic, I recommend using a distro that already has a graphical environment, since it is easier to review the Handbook in this way, and you can always repeat everything from anywhere with greater ease. I will do it from my usual Gentoo with which I write these posts.

Prepare the discs:

This step is always very personal, and it's really always a time to reflect and stop to see how you want your partition to end. As we have said that we are going to keep it simple, we are not going to use LVM or RAID, but simple and pure ext4 in our partitions. I'm going to format the usb which is the device / Dev / sdbObviously you have to accommodate your needs.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (1)

As you can see I am using fdisk because I intend to use MBR for my system, another task to solve for those who want to use UEFI πŸ˜‰

I will create a symbolic swap and a symbolic partition home just so they can follow the easiest step. / boot I am going to leave it in the root directory because as we mentioned, we will keep it simple. (We are going 1 command)

I'll end up with a structure similar to this:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (2)

we will end with w to write the disc. Depending on the partitions you have made and the types of filesystem you have placed, we will have to create them with mkfs.Something like this:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (3)

(This I will count as a single command because it is repetitive πŸ˜‰ (We are already going 2 steps).

Now we are going to mount our new system within the system that is already on. For this we use the toolmount. (I created the / mnt / gentoo directory, but that can be omitted) (We are now 3 steps.)

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (4)

With this we already have the system ready for the next step.

Stage3:

The stage3 is a tablet that is downloaded from the official Gentoo page, you can download it in your browser or from the console, for practicality reasons I will use one that I already have downloaded and I will place it in the position where I mounted the system (/ mnt / gentoo). (We are going 4 steps)

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (5)

I just want to emphasize here that I am a stage3 with systemd already included. That saves me a lot of recompilation time since several programs already come predesigned with systemd and a profile with systemd. I also removed the v option from tar so that the gitant list of extracted data does not appear, but if you want to see it, you can add it.

Now we are in this section of the Handbook

If you want to see how everything looks after unzipping you just need to use ls in the directory, and you will have something like this:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (6)

make.conf:

We are already more than halfway there, now we just have to set our hearts. For this you can read the Gentoo guide, I will only make a few adjustments, I will show you the before and after so that you can see how much I have changed.

Before:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (7)

After:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (8)

As you can see, there is not much you add, the most difficult thing to find out is the CPU_FLAGS_x86 that can be put after the complete installation and whenporterage is already working. In any case, it is good to take a look at the Handbook and review the links that appear to have more information. The mirrors list I leave it here just in case. Just choose the one that best suits you. Again, as we are keeping it simple, we are going to try not to vary things too much.

Another small tweak that we have to do as soon as the installation begins is to copy the address of our repository, we achieve this with the following command (We are going ... 5 steps, 6 counting the one that follows)

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (9)

What it does is copy the necessary configuration so that portage can download the program tree, which is the collection of ebuilds that allow you to install any package in Gentoo.

With this we already have the minimum necessary to be able to start using Gentoo on the console πŸ™‚

Chroot

Right now we find ourselves in this Handbook sectionLet's copy our current DNS, and set up a connection between the running kernel and our Gentoo environment on the partition. We are going to do this with the following commands

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (10)

It should be noted that some distributions have to mount a few extra systems, but at least the times I have tried this has been enough. If they have difficulties, the Handbook can do everything;). (We're going like ... 12 command lines, but this would be step 7)

Now we are going to enter our new Gentoo ... From here we are running the new operating system by console πŸ˜€

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (11)

The last command is optional, it simply tells us in the terminal that we are inside the chroot changing the name for better distinction πŸ™‚ (We're going 8!)

The first thing we are going to do in our new Gentoo is update the repository, we do this with the command emerge-webrsync. It is normal for some alerts to appear, it is simply that files or directories that did not exist before are being created.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (12)

Now we are going to configure a few details before updating the system (I'll explain why I do it like this in a moment). First our profile, if you have already seen my post about make.conf, you may have noticed the little extra that I left on the profiles, now it is time to start building our preferred desktop, first we will check which profile we have active withselect:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (13)

As we can see, we have a profile with amd64 and systemd by default (this is due to the option we chose from Stage3 on the official download page). To select a profile we can use the number or the name, I will put gnome with systemd but if you want kde you need to choose plasma. (If you want another, you can leave it with the systemd profile. (This is step 10 πŸ˜‰)

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (14)

The asterisk (*) indicates the selected profile.

Now we are going to download a few programs that will help us finish our installation successfully. I write them all in the same command to save numbers since I am approaching 20 πŸ˜› but don't worry, I'll explain them all:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (15)

Well, this is the list of programs that I am installing (the list on the screen is larger because of its dependencies):

  • gentoo-sources: Our source code set to install the kernel in the next step.
  • linux-firmware: Many drivers needed for various computers (my wifi driver is in this list for example)
  • genkernel-next: Tool specially designed to facilitate the kernel compilation process and initramfs creation (complexities that escape this post, but are necessary to run systemd)
  • gentoolkit: A set of Gentoo tools that allow better management of the system.
  • grub: Boot manager, very important to be able to start using our system.
  • vim: I just like it better than nano (which is the one that comes by default πŸ˜›).

Depending on the internet connection and the capacity of the processor, this may take a long time. Take this time as a reference for the next steps. (Now we are 11: O, there is little left πŸ˜‰)

Now we are going to make some minor configurations within the system:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (16)

Quickly commenting these lines in order:

  • We generate our time zone. It usually comes in the form zoneinfo / / . If you need to see your city and region you can give alsto the directory.
  • Generate our premises. Gentoo comes by default with very few locales, it is always recommended to use UTF-8 and what we do is add the one from our country to the list and generate all the ones on the list. In my case I have only put one so you can see how it is done.
  • Put our host name, any name is enough at this point πŸ˜‰

For the most demanding… we are now on to step 12 πŸ™‚ and there is very little left.

Now we will generate the file fstab, for those who do not know its use, then to read on the internet πŸ˜‰ but to give you a general idea, it is a file that is read at the moment of starting the system that allows mounting all the partitions in strategic points of the system. For now we are going to leave it with the values ​​of our partitions.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (17)

As we can see I am putting the discs on which I have placed Gentoo. You will probably use other names (sDA) and the number of options and types they want. (Step 13)

Now we will put the password of our root user.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (18)

If we wish, this is a good time to create our user or we can do it later, but remember to mount your directory home with the corresponding partition. (These steps can be counted as number 14)

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (19)

This time I'm putting a test key, but don't forget to secure your username pretty well root and the others as well. πŸ˜‰

Now that we have finished with all the previous steps, the moment of truth ...

Kernel

Our kernel will be a moment of reflection and reading, I highly recommend taking a look at the Gentoo documentation on the subject, especially I will take a couple of screenshots of a few important parts, let's go ahead:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (20)

With this we can start the configuration process, which for systemd requires a few particular details that I will show below.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (21)

Remember that the route appears at the top (the second blue line). It is necessary to have both init system as mandatory so it looks like [*].

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (22)

Some modules necessary to work with Wifi. Because nowadays we all use wifi πŸ™‚ cfg80211, mac80211.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (23)

As you can see, my Wi-Fi network card is Intel πŸ™‚ everything else just doesn't work for me, at least not on my current laptop. Each one will have to use what suits them best. Remember that lspci and lsusb are your friends πŸ˜‰

Once the configuration is finished, we save the file with the default name and exit the menu. Now it will start to compile our kernel, its modules and an initramfs will be generated to launch with systemd later.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (24)

Once finished, and if for any reason a warning appears at the end of the compilation, remember that you can repeat the process again. The configuration is stored so you will probably only have to find the options that appear with UPPER CASE using Β«/Β»And change the values ​​to the recommended ones. (This is our step 15)

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (25)

Once our new kernel is installed, it's time to tell grub to get ready to run the system. As you can see in the previous image there is a small paragraph ofWARNING, it is informing us that our system has a filesystem other than ext2. This, and one more detail, we are going to configure it in our grub before installing it. In the File/ Etc / default / grub we make the following modifications:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (26)

With this we are telling grub to prepare to use when starting the system ext4in our root (/) and have the system start with systemd instead of OpenRC. Now we can install grub to disk πŸ™‚ (steps 16 and 17 so far πŸ˜‰)

Now we are going to update the system completely. This option may take some time depending on the selected profile and the number of packages that need to be recompiled. Like theStage3 are generated from time to time, it is possible that a few packages need to be updated compared to the rest of the team (which should be as up to date as possible) In order for you to understand the commands I used you will have to readman emerges πŸ˜‰ Did you think I would leave everything totally chewed up to copy and paste? πŸ™‚

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (27)

Ready, we are almost at the goal πŸ™‚ now we only need our desktop environment, in this case you can use gnome with me, or choose plasma, or the one that best suits you πŸ™‚ This process is going to be quite long, so I recommend leaving the machine running at night, so when they wake up they can start using their system πŸ˜‰ (Step… 18 the previous one and now the 19)

Now comes the process that I will not be able to control 100% and in which it is more than likely that errors will appear. Because the package set is quite large, there may be conflicts with USE flags, so I'm going to show you how to solve them πŸ˜‰

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (28)

With this commandemerge -avwe're asking portage to calculate all dependencies, and we'll probably end up with something like this in the end.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (29)

We push No. To get an idea of ​​what just happened. We have a Stage3which came compiled with different USE flags, remember? Now that we have changed the profile, we have also changed the USE flags that came by default. and now portage is telling us that there are USE flags that it needs to have in order to compile the list of programs that we have asked (in my case gnome).

To solve these problems we are going to create a file with the name of the program (to be able to find it later easier) inside the folder/etc/portage/package.use. (If the folder doesn't exist, they can create it with the exact name)

As in my list I have two, I am going to do it as follows:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (30)

With this we have everything ready to try again πŸ™‚ but before that, I just want to clarify that I put the generic name of the program at the beginning, after the custom USE flags, they can be 1 or more, the (-) from the front says what disable and any line that starts with # is ignored by portage. Simple right? πŸ™‚ This is the magic of Gentoo customization. But I'll leave the work with portage for another post because this one is already quite long πŸ™‚ (Step 20, troubleshooting πŸ™‚)

Let's try the install command again:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (31)

As is evident, we have not finished step 20 well πŸ˜› but now we are facing 2 new errors that seem like a great opportunity to continue explaining a little portage πŸ˜‰

Air shipments are the most efficient if you need your cargo or documents to arrive quickly and securely.keywords are the labels that a program has that indicate what architecture and under what level it is supported. In this case "~ amd64 β€³ is the "not stable" branch of amd64. OpenSSL is a program that always comes with the occasional update (it is very important to keep it updated and free of problems) so it is best to use the "not stable" version. By default the laptop profiles support Β«amd64 "or" x86Β«. To change this, you need to add the variable ACCEPT_KEYWORDS = Β»~ amd64 β€³ /Β» ~ x86 β€³ inside make.conf (as I said I'm going to keep the post simple, I don't touch it any more than this).

Now for us, as in the previous step, it is necessary to create the folder package.accept_keywordsen / etc / portage and add the same format but with the KEYWORD variable that we are going to use.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (32)

They are all experts in porterageπŸ˜‰ now we are going to solve the last problem we have seen ... changes ofmask. If you are a bit observant, you can see what I show you in the image and notice that it is quite simple.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (33)

It should be noted that in this file, it is necessary to write explicitlythe version that we are going to use. In the above it is optional or you can start with Β«> = type / package-version Β»To tell portage to apply the changes from that version on. Let's retest our insalation command πŸ™‚

I never get so many errors when installing but it's great to be able to cover all kinds of events that may arise, hahaha πŸ™‚ let's look at what appeared to me:

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (34)

Here portage is telling me that I have multiple versions of the same program and they are in conflict, remembergentoolkit? We installed it along with the rest of our programs recently. We are going to use one of your commands eshowkwto see a little better what we have now.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (35)

As we can see, we already have a version of openssl installed, SLOT 0, and we want to install the one with the [M] which is SLOT 0 / 1.1 ... the / indicates that it is either one or the other, but not the two together.

As we are going to update all the programs, let's first remove the SLOT 0 to be able to update easily.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (36)

As we can see, there are going to be a couple of libraries in the system because we have only deleted the executable, to eliminate the libraries we must also use another command, but for now we are going to leave it as it is πŸ˜‰

Let's try our gnome again πŸ™‚

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (37)

All ready! And inadvertently we also cover a group of possible problems that you might face when installing πŸ™‚

Now we will leave it installing all night, it is quite as you can see, almost 1 Gb of downloads πŸ™‚

Grub

Grub installation is pretty straightforwardgrub-install / dev /

It is only worth mentioning that they must be clear that it is the complete device and not a partition. Putting it on a partition may cause nothing to work later. As elsewhere, you can downloados-prober to be able to search operating systems on other disks. The command I show has a few flaws so I'm running it on a USB and it should be on a hard drive, but you shouldn't get any errors.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (38)

Now, remember the grub setup step from recently? Well now he comes to help us. We have to create the configuration of our grub so that it boots with systemd and uses ext4 as partition for the root.

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (39)

Done πŸ™‚ now we have grub configured and ready to start the next time we turn on the equipment. (We finished step 21)

The last one is just pure detail πŸ™‚ we are going to activate our service to be able to enter visual mode the next time. Also the NetworkManager service to have our internet πŸ˜‰

The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (40)

Enjoy πŸ™‚

Well, we have reached the end and I think I only went through one step πŸ˜›, if you don't have complicated driver hardware, if you have followed this hand in hand with the Handbook, if you have been able to solve your problems along the way… CONGRATULATIONS! You are one of the privileged ones who have experienced Gentoo installation at its finest πŸ™‚

Now, what I have written is too much, and surely details will begin to emerge that I will have to put in future editions of the tutorial, but I hope it helps you start this installation process πŸ™‚ With me it will be until the next time and with another post that helps you enjoy more about Gentoo and its customization. Obviously I will also start writing other topics that I am passionate about πŸ™‚ Git and the Kernel are projects in which I collaborate (there are others as well) or I wish to do so, and if you like I can tell you a little about the process πŸ™‚

Regards,


The 20-step guide to installing Gentoo | DesdeLinux | ChrisADR (2024)

References

Top Articles
Latest Posts
Article information

Author: Tyson Zemlak

Last Updated:

Views: 6350

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Tyson Zemlak

Birthday: 1992-03-17

Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013

Phone: +441678032891

Job: Community-Services Orchestrator

Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography

Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you.