Installing Gentoo Linux - step-by-step instructions

The Linux operating system is known worldwide. Most often, inexperienced users use the Ubuntu distribution, because it is it that is simple and free. However, although other distributions are also free, they are less popular. Installation of Gentoo can be called rather complicated. But with our instructions, everything will surely work out.

gentoo installation

What is Gentoo Linux?

This is a distribution that is known for its wide capabilities, comprehensiveness, and customization capabilities. But it is worth noting that it is not for everyone, and during work you will have to actively turn on your brains, because without specialized knowledge you will not be able to use the full functionality of this OS. Often you have to turn to all sorts of instructions, but this is after. It is important to remember that installing packages in Gentoo is done from sources using the special PORTAGE tool. This is more complicated, but the user can choose which packages and features to install.

Depending on the build volume, the installation may take very little time (a couple of minutes), or it may take days.

Advantages and disadvantages

It is believed that Gentoo Linux is the fastest distribution. But everywhere and always there are certain disadvantages. "Gent" (or "Gent") refers to Source-based Linux distributions, which is why the speed of work is growing. But often the time saved has to be spent on a long installation (read: compilation) of packages. One of the key features of Gentoo is its hardware optimization . This is achieved thanks to the USE flags (more on them below) optimization and assembly of programs from source, connecting / disconnecting different modules.

The key advantage of the distribution is the ability to make anything from it. Thanks to Portage, Gen too can become a regular server or workstation. The second plus is the flexibility of use. This distribution is multi-platform and works with any processor architectures. The system has already been successfully ported to the following architectures:

  1. X86.
  2. X64
  3. ARM.
  4. PowerPc970.
  5. PowerPC
  6. Dec Alpha.
  7. IBM / 390.
  8. 68K.
  9. Sparc.
  10. PA-RISC.
  11. MIPS
  12. SuperH.
  13. PowerPC G5.

Gentoo is also protected from all sorts of vulnerabilities. Updating packages happens very quickly, as does patching vulnerability holes. There are many sites with unofficial builds of programs and official binary builds.

As a flaw, we indicate the installation process of Gentoo. For beginners who previously did not have experience using this distribution, it will be difficult. But thanks to the instructions, everything will work out.

How to install gentoo? Instruction manual

gento installation and setup

First, the Ubuntu distribution must be installed on the computer. You will need superuser rights, so make sure they are. An internet connection is also required.

The very first step is to install gentoo chroot. There are two ways to do this:

  1. At the command line, write: sudo apt-get install dchroot debootstrap.
  2. Use Synaptic to install the debootstrap and dchroot packages. This is necessary so that the Linux OS thinks that its "native" directory is different from the usual one.

Now we need to redistribute the disk partitions or create new ones if there is free space. But you need to work with partitions carefully, because there is a risk of losing all the data. Many forums write that it is preferable to have many different sections. At a minimum, you will need the main partition (/), as well as the / boot and / var partitions. Although there is still / swap (used for swap) and home / home.

how to install gentoo

After creating new partitions, format them. For / boot, / home, main (/), / var partitions, you need to use file ext3 or reiser2.

Now create the / mnt / gentoo folders. Each section we create needs its own folder.

We mount new sections here. To do this, on the command line, write:

  1. sudo mount / dev / sda5 / mnt / gentoo.
  2. sudo mount / dev / sda6 / mnt / gentoo / home.

The sda5 and sda6 sections will contain the root and home directories.

Be sure to check if the date is set correctly. If not, you can use the command and syntax to set the correct date: date MMDDhhmmYYYY.

Now open the browser and go to the distribution download site. There we look for a suitable mirror for your location.

gento how to install on uefi

From the releases / ia64 / 2008.0 / stages directory, download the stage3 tarball. Now move the archive to the Gentoo folder. We do this with the command: mv stage3 * .bz2 * / mnt / gentoo.

We go to this directory (cd / mnt / gentoo) and check the archive using md5. We write on the command line: md5sum -c stage3 * .md5. So you can check if the archive is damaged and everything is in order with it. If you do not receive an OK response, you will have to download it again.

Go to the next step of installing and configuring Gentoo. You need to extract the files from the archive. Use the command: sudo tar xvjpf stage3 * .bz2 and wait for the completion.

Gentoo Setup

Now we have the main programs in the Gentoo section. Without fail, we will need Portage - a special tool for managing packages. Thanks to him, we will gain control over the installed programs. To do this, go to the download site again. In the snapshots section, look for the latest Portage added by date. Download it and move it to the / mnt / gentoo folder. It is most convenient to simply write the command: tar xvjf /mnt/gentoo/portage-.tar.bz2 -C / mnt / gentoo / usr.

What is Portage?

A few words should be said about this tool. Portage is a system with which you can manage packages in a distribution. It is designed to simplify the installation of programs and source codes. With its help, you can delete packages, update them, synchronize using rsync protocol. As soon as Portage downloads files, the system compiles the program using the downloaded sources and optimizes it.

kde gentoo installation

At this point, install compile flags. Open make.conf, which is located in the / gentoo / etc directory. We use a regular text editor. The make.conf.example document describes the statement with make variables. Get to know her well. Use the specified variables and configuration file for installation.

We should make sure that the settings were transferred from the Ubuntu distribution without changes. The main thing is the dns configuration (sudo cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf) and the proc system (sudo mount -t proc none / mnt / gentoo / proc).

If everything is ok with the settings, go to chroot. To make it, you need:

  1. Change the root directory. At the command prompt, write: sudo chroot / mnt / gentoo / bin / bash
  2. Refresh the environment and make it clear to the terminal where it is located. At the command prompt: / usr / sbin / env-update.
  3. Put this in memory: source / etc / profile.

From now on, you are inside the Gentoo system.

gentoo package installation

Kernel compilation

The most important stage is the compilation of the kernel - the part of the system that determines when and which program to give access to. Without a kernel, no operating system works. We also install packages from the rsync server. We enter the command for this: emerge --sync. For clarity, suppose that the 2.6 kernel will be installed. At this point, you need to declare USE flags that make it clear to the compiler which options and features to apply. It is important to indicate the correct flags, otherwise the result may not be quite expected.

Each flag added is a word. Options to be deleted are indicated by a β€œ-” before the word. For example, to install and compile programs and options with ogg support, we just need to add ogg. If we do not need this, then write -ogg.

To understand which USE flags to choose, be sure to see the Gentoo documentation.

After selecting the flags, open make.conf in the / etc / directory and enter them.

gentoo installation

Setting the time zone

The next step is to set the time zone. All of them are in the / usr / share / zoneinfo directory. We go here, enter the ls command and see a list of available ones. We need to copy the time zone to / etc / localtime. We use the command for this: # cp / usr / share / zoneinfo / GMT / etc / localtime.

After setting the time zone, you can load and compile the kernel. We enter the command: # emerge gentoo-sources. Now the most difficult step is to configure the kernel so that it has support for the packages we need. If the kernel is not installed correctly, the necessary functions may not be available.

We launch:

  • cd / usr / src / linux;
  • make menuconfig.

So we get into the kernel settings. We select all the drivers necessary for loading the system. You need to check that they are all embedded in the kernel, otherwise the system will not be able to boot corny. Remember to enable support for your file system. If possible, choose all the necessary network drivers: wireless and local network, as well as the type and family of processor.

Now, to start compilation, enter: make && make modules_install. The process will take some time. Then enter: make -j2 && make modules_install. Copy the kernel image to the / boot folder.

Last - tuning kernel modules. To find all available modules, run the command: find / lib / modules / (kernel version) / -type f -iname '* .o' -or -iname '* .ko'. Add from the list to the folder /etc/modules.autoload.d/kernel-2.6 those that are loaded automatically. At this point, the Gentoo installation is complete. You can start working with the OS.

KDE Gentoo Installation Tips

gentoo linux

There will be problems during the installation process. It simply cannot be otherwise. Be sure to check out the Gentoo forum to help you out. In any case, follow these instructions.

There is often debate about how to install Gentoo on UEFI. It is important that an EFI partition be created. It should be a variant of the FAT file system. The UEFI specification says that UEFI-firmware works with FAT12, 16 and 32, but it is recommended to use the FAT32 system.

Also, the tarage may not include the portage group and user. When using schroot on a host system, they must be created manually. In this case, the files in the / gentoo / etc directory and the password will be overwritten (you can change them directly).

Source: https://habr.com/ru/post/C18082/


All Articles