User:Immolo/Arch Destroyer 2000
Gentoo provides a server hosting binary packages; the packages are also distributed via the Gentoo mirrors. For amd64 (x86-64) and arm64 (aarch64) the files include many packages used on a desktop system, from KDE Plasma to Gnome and from LibreOffice to TeXLive, and are updated daily. For other architectures and system types, the package directories contain just the core packages, which are updated approximately once a week. A common misconception about Gentoo is that you must compile everything from source. In reality, Gentoo aims to provide users with the choice to use the distribution in the way that suits them best (see here for further information.)
There are several key benefits to using a binary host:
- Easier to get a full install up and running
- No longer limited by storage or RAM availability for larger packages, I.E. some packages need X GB of RAM free
- Older systems not limited by resources to compile larger apps
- Fast update and fast set-up time for cloud instances
The main downsides of using a binhost are: losing -march=native
, which reportedly gives a 5% boost on x86_64 processors, and if a useflag is changed from the default setting then the package will need to be re-compiled.
The main article describes using the fully supported binary host for amd64 and arm64 with the settings the packages are compiled with, the sub articles will show what is supported on other architectures and profiles.
Configuration
binrepos.conf
The file /etc/portage/binrepos.conf tells portage where to find the binary package files. New Stage3 files already come with a suitable binrepos.conf; in existing installations you will have to add it.
Using a local Gentoo mirror is highly recommend to reduce server load and to speed up downloads on the local end.
/etc/portage/binrepos.conf
UK Mirror Example, amd64[binhost]
priority = 9999
sync-uri = https://mirror.bytemark.co.uk/gentoo/releases/amd64/binpackages/17.1/x86-64/
/etc/portage/binrepos.conf
CN Mirror Example, arm64[binhost]
priority = 9999
sync-uri = https://mirrors.aliyun.com/gentoo/releases/arm64/binpackages/17.0/arm64
The URI in the file contains at its end your architecture and your type of installation. The examples above are given for normal amd64 or arm64 installations.
If you use any of hardened, musl, llvm profile, x32, or even an entirely different architecture, these paths are not correct for you. Corresponding directories exist, but have only the Stage3 package set.
Package signature verification
Now install the Gentoo Trust Tool known as getuto
This is currently a testing package so enable it with the follow:
/etc/portage/package.accept_keywords/getuto
app-portage/getuto
root #
emerge --ask app-portage/getuto
Next, run getuto to install the keys.
root #
getuto
Finally, add the following to the make.conf to enable verification of GPG signatures:
/etc/portage/make.conf
FEATURES="binpkg-request-signature"
EMERGE_DEFAULT_OPTS
Below are some useful settings that can be applied to make the experience of using the Gentoo Binpackage better for a user's needs.
--binpkg-respect-use
This is set with either --binpkg-respect-use=y
or --binpkg-respect-use=n
, this tells portage to ignore the differences between a user's make.conf and install the binpkg anyway or tell portage to compile the package with the user's wishes for their system.
This can be set with the following:
/etc/portage/make.conf
EMERGE_DEFAULT_OPTS="--binpkg-respect-use=n"
--with-bdeps
This can also be set with a Y or N and which ignore pulling in build dependencies if --with-bdeps n
is set which could be very useful for users that only wish to have Gentoo system that uses binary packages only.
/etc/portage/make.conf
EMERGE_DEFAULT_OPTS="--with-bdeps n"
--getbinpkg and --getbinpkgonly
Adding --getbinpkg
will automatically use the binpkg when one is suitable without the need to add it when using emerge in the command line.
--getbinpkgonly
on the other hand will tell portage to only use binpkgs and then exit the process if one isn't found or suitable for the system. This option should always be set with --with-bdeps n
for a system planning to be a binary only install to aid with system administration.
/etc/portage/make.conf
EMERGE_DEFAULT_OPTS="--getbinpkg"
Emerging packages
Essentially you just need to add a single switch to the emerge command line, -g or --getbinpkg.
Single Package
To install a single package using the binhost use the below command:
root #
emerge --ask --verbose --getbinpkg app-editors/nano
or the shorthand:
root #
emerge -avg app-editors/nano
System Update
To perform a system updating using the binhost use:
root #
emerge --ask --verbose --update --deep --changeduse --getbinpkg @world
or shorthand:
root #
emerge -avuDUg @world
Package Settings
amd64, amd64/17.1/x86-64
CFLAGS
The packages are built with CFLAGS="-O2 -pipe -march=x86-64 -mtune=generic"
which means all x86-64 CPUs are supported.
Profiles
This binhost is built with useflags of the following profiles:
default/linux/amd64/17.1/no-multilib
default/linux/amd64/17.1/desktop/gnome/systemd
default/linux/amd64/17.1/desktop/plasma/systemd
This will cover most of the useflag combinations needed for both a openrc and systemd system.
arm64, arm64/17.0/arm64
CFLAGS
The packages are built with CFLAGS="-O2 -pipe"
which means all arm64 (aarch64) CPUs are supported.
Profiles
This binhost is built with useflags of the following profiles:
default/linux/arm64/17.0
default/linux/arm64/17.0/desktop/gnome/systemd
default/linux/arm64/17.0/desktop/plasma/systemd
This will cover most of the useflag combinations needed for both a openrc and systemd system.