We are still actively working on the spam issue.

Difference between revisions of "Gentoo"

From InstallGentoo Wiki
Jump to: navigation, search
m (Funtoo Linux)
(14 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
[[File:Gentoo.png|thumb|Gentoo logo]]
 
[[File:Gentoo.png|thumb|Gentoo logo]]
'''Gentoo Linux''' is a source-based [[GNU/Linux]] distribution. It has a stigma for being a difficult distribution to use, and is often recommended as a solution to any problem on /g/. After all, if the person asking the question could install [http://funroll-loops.info/ Gentoo], they could probably figure out whatever problem they're having in the first place. If you are considering installing Gentoo, the best resource available to you is the [http://www.gentoo.org/doc/en/handbook/index.xml Gentoo Handbook].  
+
'''Gentoo Linux''' is a source-based [[Linux]] distribution. It has a stigma for being a difficult distribution to use, and is often recommended as a solution to any problem on /g/. After all, if the person asking the question could install [http://funroll-loops.info/ Gentoo], they could probably figure out whatever problem they're having in the first place. If you are considering installing Gentoo, the best resource available to you is the [http://www.gentoo.org/doc/en/handbook/index.xml Gentoo Handbook].  
  
 +
== Installation method ==
 +
Most distros include some form of graphical installer. Gentoo is installed by manually partitioning a device, extracting a stage3 tarball, extracting a portage snapshot, compiling a kernel, installing a bootloader, and then configuring various files that are needed to get it up and running. In those regards, it is somewhat similar to installing Debian with debootstrap, Fedora with febootstrap, or an Arch Linux install.
  
== Differences between Gentoo and other Distros ==
+
Because of this highly manual approach to installing the system, always keep in mind that installing Gentoo will probably be literally the longest operating system install in your life, EVER. '''You have been warned.''' Take your time when installing Gentoo, expect the installation to be a wild ride of problems, achievements and milestones, and don't try to rush it. If you're a NEET with literally nothing else to do you might be able to rush a Gentoo installation in at least 24 hours; if you're a busy person with a day job and friends, it might take you over an entire week to set everything up.  
Gentoo is different than most other Linux distributions, all the way down to how it is installed.
 
  
=== Installation Method ===
+
To make yourself an idea of what awaits you (and in case you fell for the "INSTALL GENTOO" maymay): on a 2014 mid-end quad core laptop CPU with 8 GB of RAM, setting up the minimum system (the stage-3 tarball + Portage snapshot) will take you about an hour, compiling the kernel an hour and a half (assuming you're cheating with {{ic|genkernel}} instead of undertaking a manual compilation and fixing an endless series of kernel panics), finishing your basic installation another hour, installing the graphical interface at least 2 hours (because the GUI is an optional component in Gentoo), and installing Google Chrome or Firefox at least 2 hours each while the entire software compiles from source code. And that's assuming you're the luckiest person in the world and don't run into a single problem, pitfall or having to mess with a poorly documented system component -- if this happens, add at least another 4 hours. Oh, and if you're planning on using a LUKS volume, add another 4 hours while your system fills a 750 GB disk with pseudorandom data using a fast drive filling method because /dev/urandom is too slow for this task.
Most other distros include some form of graphical installer. Gentoo is installed by manually partitioning a device, extracting a stage3 tarball, extracting a portage snapshot, compiling a kernel, installing a bootloader, and then configuring various files that are needed to get it up and running. In those regards, it is somewhat similar to installing Debian with debootstrap, Fedora with febootstrap, or an Arch Linux install.  
 
  
'''Because of this highly manual approach to installing the system, always keep in mind that installing Gentoo will probably be LITERALLY THE LENGTHIEST SOFTWARE INSTALLATION IN YOUR ENTIRE LIFE. IN FACT, THIS IS WHY WE TROLL UNSUSPECTING NOOBS INTO INSTALLING GENTOO. YOU HAVE BEEN WARNED. So take your time when installing Gentoo, expect the installation to be a wild ride of problems, achievements and milestones, and don't try to rush it.''' If you're a NEET with literally nothing else to do you might be able to rush a Gentoo installation in at least 24 hours; if you're a busy person with a day job and friends, it might take you over an entire week to set everything up. On a 2014-semi-modern quad core CPU with 8 GB of RAM, setting up the minimum system (the stage-3 tarball + Portage snapshot) will take you about an hour, compiling the kernel an hour and a half (assuming you're cheating with genkernel instead of undertaking a manual compilation and fixing an endless series of kernel panics), finishing your basic installation another hour, installing the graphical interface at least 2 hours (because the GUI is an optional component in Gentoo), and installing Google Chrome or Firefox ''at least 20 minutes each'' while the entire software compiles from source code. And that's assuming you're the luckiest person in the world and don't run into a single problem, pitfall or having to mess with a poorly documented system component -- if this happens, add at least another 4 hours. Oh, and if you're planning on using a LUKS volume, add another 24 hours while your system fills a 750 GB disk with pseudorandom data using four concurrent jobs to exploit your four CPU cores.
+
== Package manager ==
 
 
=== Package Manager ===
 
 
Gentoo's package manager, portage, is more similar to what you will find in BSD than in other Linux distributions. Portage tracks installation scripts, called ebuilds, for almost every package you can imagine by default. These ebuilds contain all the information necessary to automatically download a project's source, compile, and install it. If a package is not available for default, you can add other "repositories" as overlays on top of the default Gentoo overlay.  
 
Gentoo's package manager, portage, is more similar to what you will find in BSD than in other Linux distributions. Portage tracks installation scripts, called ebuilds, for almost every package you can imagine by default. These ebuilds contain all the information necessary to automatically download a project's source, compile, and install it. If a package is not available for default, you can add other "repositories" as overlays on top of the default Gentoo overlay.  
  
==== USE Flags ====
+
=== USE flags ===
One of the most prominent features of Gentoo is the ability to custom tailor the features of software via USE flags. USE flags are a handy way of automatically specifying options to a piece of software's configuration script during compile time. For example, it is trivial to blacklist something like PulseAudio by simply including -pulseaudio into your global USE flags. USE flags can be specified globally in /etc/portage/make.conf or on a per-package basis through /etc/portage/package.use
+
One of the most prominent features of Gentoo is the ability to custom tailor the features of software via USE flags. USE flags are a handy way of automatically specifying options to a piece of software's configuration script during compile time. For example, it is trivial to blacklist something like PulseAudio by simply including {{ic|-pulseaudio}} into your global USE flags. USE flags can be specified globally in {{ic|/etc/portage/make.conf}} or on a per-package basis through {{ic|/etc/portage/package.use}}
  
==== CFLAGS ====
+
=== CFLAGS ===
Typical of building from source, you are able to specify CFLAGS that add additional optimizations to the compiled software, the most common ones being "-O2 -march=native" to specify average-level optimization tailored for whatever CPU your computer has.
+
Typical of building from source, you are able to specify CFLAGS that add additional optimizations to the compiled software, the most common ones being {{ic|1=-O2 -march=native}} to specify average-level optimization tailored for whatever CPU your computer has.
  
==== Overlays ====
+
=== Overlays ===
Additional repositories of ebuilds are known as overlays. It is common practice to have a local overlay for any custom ebuilds you have created or acquired. Overlays are typically managed with the layman utility.  
+
Additional repositories of ebuilds are known as overlays. It is common practice to have a local overlay for any custom ebuilds you have created or acquired. Overlays are typically managed with the {{ic|layman}} utility.  
  
==== License Enforcement ====
+
=== License enforcement ===
Portage allows you to specify which licenses you agree with, to prevent any software with other licenses from being automatically pulled in at any point. For example, you can restrict installed software to only that which is FSF approved by including ACCEPT_LICENSE="-* @FREE" into /etc/portage/make.conf
+
Portage allows you to specify which licenses you agree with, to prevent any software with other licenses from being automatically pulled in at any point. For example, you can restrict installed software to only that which is FSF and OSI-approved by including {{ic|1=ACCEPT_LICENSE="-* @FREE"}} into {{ic|/etc/portage/make.conf}}
  
==== Release Schedule ====
+
=== Release schedule ===
 
Gentoo is a rolling-release distribution that allows you to mix channels on a per-package basis. For example, you can maintain a system on the stable channel and selectively install unstable releases, or even compile the latest development releases from Git/SVN/etc. Because of this, Gentoo can be either extremely stable or on the very bleeding edge, depending on how you configure it.
 
Gentoo is a rolling-release distribution that allows you to mix channels on a per-package basis. For example, you can maintain a system on the stable channel and selectively install unstable releases, or even compile the latest development releases from Git/SVN/etc. Because of this, Gentoo can be either extremely stable or on the very bleeding edge, depending on how you configure it.
  
=== Init System ===
+
== Init system ==
Gentoo uses OpenRC for its init system. It also gives you the option of using systemd if you so choose.
+
By default, Gentoo uses OpenRC for its init system. It also gives you the option of using systemd if you so choose.
  
== Related Distributions ==
+
== Related distributions ==
  
 
=== Gentoo variants ===
 
=== Gentoo variants ===
  
 
Like most distros, Gentoo has a few variants that are based off of it.
 
Like most distros, Gentoo has a few variants that are based off of it.
 +
 +
==== [https://cloveros.ga CloverOS] ====
 +
CloverOS is a system made by /tech/ and /g/ user Jesus (also of the 8chan [[IRC]]). It hosts its own repository of binaries, and has a customized version of FVWM as its default desktop environment. It has many preinstalled binaries for the 8chan user in mind. It has become popular enough to have independent reviews, and its own entry on DistroWatch.
  
 
==== [http://www.funtoo.org/ Funtoo Linux] ====
 
==== [http://www.funtoo.org/ Funtoo Linux] ====
Line 51: Line 52:
 
** <strike>Funtoo uses an older version of udev than Gentoo, which may cause some compatibility issues with certain software like systemd if you choose to use it.</strike> Funtoo now uses eudev by default.
 
** <strike>Funtoo uses an older version of udev than Gentoo, which may cause some compatibility issues with certain software like systemd if you choose to use it.</strike> Funtoo now uses eudev by default.
 
** Funtoo's ebuilds do not always contain the same features as Gentoo's. For example, some are missing ABI flags. <strike>E.g. As of 2014-01-29 Funtoo does not contain [http://gpo.zugaina.org/sys-apps/tcp-wrappers tcp-wrappers] 7.6.22-r1, which added such support while Gentoo does</strike> Funtoo now has up-to-date tcp-wrappers. Having many packages missing that support makes a multilib system with gx86-multilib very difficult.
 
** Funtoo's ebuilds do not always contain the same features as Gentoo's. For example, some are missing ABI flags. <strike>E.g. As of 2014-01-29 Funtoo does not contain [http://gpo.zugaina.org/sys-apps/tcp-wrappers tcp-wrappers] 7.6.22-r1, which added such support while Gentoo does</strike> Funtoo now has up-to-date tcp-wrappers. Having many packages missing that support makes a multilib system with gx86-multilib very difficult.
 
== Instructions For Installing Gentoo ==
 
 
Something that might that might really speed up the process and probably wouldn't hurt to try is putting <code>--buildpkg</code> when emerging things, like <code>emerge --buildpkg firefox</code>. To see about doing this just control-f for "prebuilt" in the Gentoo Handbook. Try it because Firefox really will take 17 hours to compile for you.
 
 
If you type in something wrong during the course of this and you want your computer to stop a process, do control-c. You might have to do it a few times. Just keep doing it until it stops the process.
 
 
Here we go!
 
 
<code>
 
passwd
 
 
parted -a optimal /dev/sda
 
 
mklabel gpt
 
 
unit mib
 
 
mkpart primary 1 3 </code>(Since this is only 2 megabytes I add way more to this because my hard drive has way more space than I need. I do 5 gigabytes or something which is probably really unnecessary.)
 
 
<code>
 
name 1 grub
 
 
set 1 bios_grub on
 
 
mkpart primary 3 131</code> (I also make stuff like this 20 gigabytes.)
 
 
<code>
 
name 2 boot
 
 
mkpart primary 131 643
 
 
name 3 swap
 
 
mkpart primary 643 -1
 
 
name 4 rootfs
 
 
print
 
 
quit
 
 
mkfs.ext2 /dev/sda2
 
 
mkfs.ext4 /dev/sda4
 
 
mkswap /dev/sda3
 
 
swapon /dev/sda3
 
 
mount /dev/sda4 /mnt/gentoo
 
 
mkdir /mnt/gentoo/boot
 
 
mount /dev/sda2 /mnt/gentoo/boot
 
 
date
 
 
date MonthDayHourMinuteYear
 
 
for example august 17 2014 at 12:19 AM
 
 
date 081700192014
 
 
cd /mnt/gentoo
 
 
links http://www.gentoo.org/main/en/mirrors.xml
 
 
</code>
 
Go to the server Argonne National Laboratory (http) or whatever
 
 
Go to releases. Get stage3-<InsertDateHere>-bz2 I think.
 
 
<code>q</code>to exit
 
 
<code>tar xvpjf stage3</code>(At this point, hit the tab button and the rest will fill out.)
 
 
This will probably take up to 30 minutes.
 
 
<code>cp -L /etc/resolv.conf /mnt/gentoo/etc/
 
 
mount -t proc proc /mnt/gentoo/proc
 
 
mount --rbind /sys /mnt/gentoo/sys
 
 
mount --rbind /dev /mnt/gentoo/dev
 
 
chroot /mnt/gentoo /bin/bash
 
 
source /etc/profile
 
 
export PS1="(chroot) $PS1"
 
 
emerge-webrsync
 
 
emerge --sync
 
 
eselect profile list
 
</code>
 
I just go with the desktop profile and emerge XFCE but you might want to go with KDE, GNOME, LXDE, or any other DE/WM.
 
<code>
 
eselect profile set (whatever)
 
 
ls /usr/share/zoneinfo
 
 
echo "EST" </code>(or whatever)<code> > /etc/timezone
 
 
emerge --config sys-libs/timezone-data
 
 
emerge gentoo-sources
 
 
emerge genkernel
 
 
nano -w /etc/fstab
 
</code>
 
Simply change, where it says <code>/dev/BOOT</code> (I think), <code>BOOT</code> to <code>sda2</code>. That's all. Exit by pressing control-x  and save it.
 
<code>
 
genkernel</code> all (this literally takes like an hour and 40 minutes on my dual core 2.66 ghz computer, so find something to do.)
 
<code>
 
nano -w /etc/fstab
 
</code>
 
Change <code>/dev/ROOT</code> to <code>/dev/sda4</code> and ALSO change <code>ext2</code> to <code>ext4</code> because that's what you did earlier with "<code>mkfs.ext4 /dev/sda4</code>". Also, change <code>/dev/SWAP</code> to <code>/dev/sda3</code>. Exit and save it with <code>CTRL-X</code>.
 
<code>
 
cd /etc/init.d
 
</code>
 
Before this next part run <code>ifconfig</code>. For me, and I think maybe a lot of people what is normally eth0 for the ethernet cord is <code>enp0s25</code> or some other random variation of that. Wireless is usually <code>wlp3s0</code>. You should be able to tell what your ethernet card is.
 
<code>
 
ln -s net.lo net.eth0</code> (For me it would be <code>ln -s net.lo net.enp0s25</code> so do whatever it is for you.)
 
 
<code>
 
rc-update add net.eth0 default</code> (again, replace net.eth0 with net.whatever it is for you)
 
 
<code>
 
passwd </code>(yes, you need to set another password)
 
<code>
 
emerge syslog-ng
 
 
rc-update add syslog-ng default
 
 
emerge dhcpcd
 
 
emerge sys-boot/grub
 
 
grub2-install /dev/sda
 
 
grub2-mkconfig -o /boot/grub/grub.cfg
 
 
exit
 
 
umount -l /mnt/gentoo/dev
 
 
umount -l /mnt/gentoo/sys
 
 
umount -l /mnt/gentoo/proc
 
 
umount -l /mnt/gentoo/boot
 
 
umount -l /mnt/gentoo
 
 
reboot
 
 
log in as root. </code>It will say "localhost" as your device name.
 
 
You should now create a user. This user will be named <code>jimmy</code>.
 
 
<code>useradd -m -G users,wheel,audio,cdrom,usb,video,portage -s /bin/bash jimmy
 
 
passwd jimmy </code>(Here is where you set the password for <code>jimmy</code>.)
 
 
Now you technically have gentoo installed and if you want you can do something like
 
<code>links http://www.wikipedia.org</code>
 
and you can see that you can browse websites with text only.
 
 
You need to install 3 things to have a working desktop (don't do it before reading these instructions): X or Xorg, a desktop environment (KDE, GNOME or XFCE) and Firefox.
 
 
Before you install XFCE you will need to install X.org.
 
 
Before you install Xorg: set your USE flags to <code>-gnome -kde -minimal -qt4 dbus jpeg lock session startup-notification thunar udev X</code>
 
 
To do that, do this:
 
 
<code>nano -w /etc/portage/make.conf</code>
 
 
There's a line that says USE=bindist or something close. We'll add on to that all of that stuff, with the quotation marks. Do <code>CTRL-0</code> to save and <code>CTRL-X</code> to exit.
 
 
Whenever you change your USE flags you then have to do this: <code>env-update</code>
 
 
I guess at this point you might want to consider using <code>--buildpkg</code> to just download things instead of compiling it on your computer. I guess the point of Gentoo is compiling it yourself, but I doubt someone will try to spy on you with Gentoo.
 
 
Now, run:
 
<code>emerge --ask xorg-server</code>
 
 
After 5 hours has passed (depending on your processor speed) and it looks like X.org is done compiling, do startx and see what happens.
 
 
Next you should emerge XFCE, by doing <code>emerge --ask xfce4-meta</code>.
 
 
My first time I didn't have a lot of trouble with emerging Xorg and XFCE but Gentoo might have changed. Just Google stuff if you have any problems.
 
 
It took 35 hours for me to originally emerge X, XFCE and Firefox. To start all of this, after you have installed it, you simply put in "startx" as the user.
 
 
So to repeat, to install stuff with Gentoo you simply do <code>emerge <insertprogram></code> like <code>emerge firefox</code> or <code>emerge gedit</code>.
 
 
One thing you should occasionally update Gentoo with is "emerge --sync". Google for other stuff to update with.
 
 
The thing is once you have a basic desktop with Firefox and a terminal, when you emerge anything you can still use Firefox or whatever while you wait for it to emerge. Firefox, at 17 hours, took by far the longest to compile out of anything I ever emerged.
 
 
You can now start using Gentoo!
 
  
 
[[Category:GNU/Linux]]
 
[[Category:GNU/Linux]]
 
[[Category:Distros]]
 
[[Category:Distros]]
 +
[[Category:Operating systems]]

Revision as of 10:06, 20 May 2020

Gentoo logo

Gentoo Linux is a source-based Linux distribution. It has a stigma for being a difficult distribution to use, and is often recommended as a solution to any problem on /g/. After all, if the person asking the question could install Gentoo, they could probably figure out whatever problem they're having in the first place. If you are considering installing Gentoo, the best resource available to you is the Gentoo Handbook.

Installation method

Most distros include some form of graphical installer. Gentoo is installed by manually partitioning a device, extracting a stage3 tarball, extracting a portage snapshot, compiling a kernel, installing a bootloader, and then configuring various files that are needed to get it up and running. In those regards, it is somewhat similar to installing Debian with debootstrap, Fedora with febootstrap, or an Arch Linux install.

Because of this highly manual approach to installing the system, always keep in mind that installing Gentoo will probably be literally the longest operating system install in your life, EVER. You have been warned. Take your time when installing Gentoo, expect the installation to be a wild ride of problems, achievements and milestones, and don't try to rush it. If you're a NEET with literally nothing else to do you might be able to rush a Gentoo installation in at least 24 hours; if you're a busy person with a day job and friends, it might take you over an entire week to set everything up.

To make yourself an idea of what awaits you (and in case you fell for the "INSTALL GENTOO" maymay): on a 2014 mid-end quad core laptop CPU with 8 GB of RAM, setting up the minimum system (the stage-3 tarball + Portage snapshot) will take you about an hour, compiling the kernel an hour and a half (assuming you're cheating with genkernel instead of undertaking a manual compilation and fixing an endless series of kernel panics), finishing your basic installation another hour, installing the graphical interface at least 2 hours (because the GUI is an optional component in Gentoo), and installing Google Chrome or Firefox at least 2 hours each while the entire software compiles from source code. And that's assuming you're the luckiest person in the world and don't run into a single problem, pitfall or having to mess with a poorly documented system component -- if this happens, add at least another 4 hours. Oh, and if you're planning on using a LUKS volume, add another 4 hours while your system fills a 750 GB disk with pseudorandom data using a fast drive filling method because /dev/urandom is too slow for this task.

Package manager

Gentoo's package manager, portage, is more similar to what you will find in BSD than in other Linux distributions. Portage tracks installation scripts, called ebuilds, for almost every package you can imagine by default. These ebuilds contain all the information necessary to automatically download a project's source, compile, and install it. If a package is not available for default, you can add other "repositories" as overlays on top of the default Gentoo overlay.

USE flags

One of the most prominent features of Gentoo is the ability to custom tailor the features of software via USE flags. USE flags are a handy way of automatically specifying options to a piece of software's configuration script during compile time. For example, it is trivial to blacklist something like PulseAudio by simply including -pulseaudio into your global USE flags. USE flags can be specified globally in /etc/portage/make.conf or on a per-package basis through /etc/portage/package.use

CFLAGS

Typical of building from source, you are able to specify CFLAGS that add additional optimizations to the compiled software, the most common ones being -O2 -march=native to specify average-level optimization tailored for whatever CPU your computer has.

Overlays

Additional repositories of ebuilds are known as overlays. It is common practice to have a local overlay for any custom ebuilds you have created or acquired. Overlays are typically managed with the layman utility.

License enforcement

Portage allows you to specify which licenses you agree with, to prevent any software with other licenses from being automatically pulled in at any point. For example, you can restrict installed software to only that which is FSF and OSI-approved by including ACCEPT_LICENSE="-* @FREE" into /etc/portage/make.conf

Release schedule

Gentoo is a rolling-release distribution that allows you to mix channels on a per-package basis. For example, you can maintain a system on the stable channel and selectively install unstable releases, or even compile the latest development releases from Git/SVN/etc. Because of this, Gentoo can be either extremely stable or on the very bleeding edge, depending on how you configure it.

Init system

By default, Gentoo uses OpenRC for its init system. It also gives you the option of using systemd if you so choose.

Related distributions

Gentoo variants

Like most distros, Gentoo has a few variants that are based off of it.

CloverOS

CloverOS is a system made by /tech/ and /g/ user Jesus (also of the 8chan IRC). It hosts its own repository of binaries, and has a customized version of FVWM as its default desktop environment. It has many preinstalled binaries for the 8chan user in mind. It has become popular enough to have independent reviews, and its own entry on DistroWatch.

Funtoo Linux

Funtoo.png

A fork of Gentoo by Gentoo's founder Daniel Robbins. It aims to correct some issues he sees with Gentoo that he wasn't able to rectify because of internal dispute. It also aims to be slightly easier than Gentoo, and offers more optional preconfiguration by default because of that. To that end, Funtoo ships with ebuilds that support the binary USE flag, allowing users to skip the step of customizing their own kernel if they so desire.

  • Advantages
    • Includes some ebuilds that Gentoo doesn't by default.
    • Initial setup may be slightly easier than Gentoo.
    • Uses Git for portage syncing instead of rsync.
    • Common Gentoo scripts and programs patched with Funtoo specific features (genkernel, portage, rc-update, etc).
  • Disadvantages
    • Funtoo uses an older version of udev than Gentoo, which may cause some compatibility issues with certain software like systemd if you choose to use it. Funtoo now uses eudev by default.
    • Funtoo's ebuilds do not always contain the same features as Gentoo's. For example, some are missing ABI flags. E.g. As of 2014-01-29 Funtoo does not contain tcp-wrappers 7.6.22-r1, which added such support while Gentoo does Funtoo now has up-to-date tcp-wrappers. Having many packages missing that support makes a multilib system with gx86-multilib very difficult.