This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!
Gentoo packages management¶
Table of contents¶
- Packages basics
- Packages investigation
- Packages updates
- Packages Logs
- Packages sets
- Packages slots
- Packages troubleshooting
Search a package:
Install a package:
Remove a package (all system wide configuration files and all dependencies, except
List all installed packages:
Downgrade a package (e.g. mesa should be
equery is a wonderful tool to investigate any package:
Update packages repositories¶
Update a specific package¶
Update all system¶
Update all repositories:
If, at the end of the
emaint sync -acommand, you get a message like the following one:Then you will notice that the repository
some-failing-overlay-repohas not been successfully synced (
returned code = 1).
In that case, if you see this kind of error message:Then you can fix it like so:
... >>> Syncing repo 'some-failing-overlay-repo' into '/var/db/repos/some-failing-overlay-repo'... /usr/bin/git fetch origin Updating ... error: Your local changes to the following files would be overwritten by merge: ... <list of files> ... Please commit your changes or stash them before you merge. Aborting ...See https://forums.gentoo.org/viewtopic-t-1077536-start-0.html.
emerge --synccommand is a compatibility command. Sync operations should now be performed using the new
emaint syncmodule. This new
emaint syncmodule has greater functionality and flexibility. See
Run the global update:
If you want to allow the Linux kernel package (
gentoo-sources) to be updated, then you might also want to make sure the current version of your kernel is part of your
After the global update command (
# emerge -avuDN ...), the following message might appear:
IMPORTANT: N config files in '/etc' need updating.. In this case run the
dispatch-confcommand, and re-run the global update.
If you get a "Failed to emerge" error during the global update, then re run
# emaint sync -aand
# emerge -avuDN ...again. If the problem remains, it might be because a package requires a lot of memory in order to compile, try again after closing every big running programs (if any) like Steam, Firefox, etc. If the problem still remains, further investigation will be needed...
Now, update all new packages that are still built against their old version (run it a few times if it still says
!! existing preserved libs...):
# emerge @preserved-rebuildcommand complains with the following message:
!! existing preserved libs...then run it a few more time until it stops complaining.
If it still complains (even after running it a few times), e.g. (https://forums.gentoo.org/viewtopic-t-1057608.html):Then just
!! existing preserved libs: >>> package: sys-libs/db-4.8.30-r2 * - /usr/lib64/libdb-4.8.so * used by /usr/lib64/sasl2/libsasldb.so.3.0.0 (dev-libs/cyrus-sasl-2.1.26-r9) * used by /usr/sbin/saslauthd (dev-libs/cyrus-sasl-2.1.26-r9) * used by /usr/sbin/sasldblistusers2 (dev-libs/cyrus-sasl-2.1.26-r9) Use emerge @preserved-rebuild to rebuild packages using these libraries
emergeback the package that causes difficulties:
Clean the system by removing/rebuilding packages:
If you allowed the Linux kernel package (
gentoo-sources) to be updated, then you might want to make sure the current version of your kernel is part of your
If the previous command complains about "broken orphaned files", it's probably because you installed something from source that put files into
$ sudo make install. E.g. after installing
Then if you know the origin of those file (e.g.
rtagscase): it's fine, let those file be. You can add them to
/etc/revdep-rebuild/99revdep-rebuildto ignore them in the future:
Finally, clean/remove source code of old packages:
If a global update (
# emerge -avuDN ... command) has been run and that new
(new kernel) have been installed: take a look at how to update the
Special updates (after other installations or updates)¶
upgrade GCC : https://wiki.gentoo.org/wiki/Upgrading_GCC
update all cargo packages (need to install
$ cargo install install-update")
You can check the daily logs like so:
You can read the Gentoo news like so:
You can also read them all here: https://www.gentoo.org/support/news-items/
@systemset: the system set, contains the packages required for a standard Gentoo to run properly.
@profileset: the profile set, contains the packages required for a profile.
@selectedset: The selected set contains the packages the admin has explicitly installed. With a couple of exceptions, Portage will register those specified packages in the
@world: The world set, encompasses the
@profileset and the
@selectedset. Whenever updating, portage will update to the last version the packages in the
@worldset (if no specific version has been specified). A package in this set might sometimes be called a "main package", in opposition with its "dependency packages" which are outside of this set (a dependency package is updated whenever it needs to be by portage, to the right version). Every package emerged without the
-1) will end up in the
@worldset. You don't want a "dependency packages" to be here, because this package might be updated to the wrong version and break it's associated "main package".
More information about those sets and all the others:
@selected set packages (manually installed packages)¶
Emerge a package, from outside the
@worldset, to the
@selectedset without recompiling the package:
Emerge a package with a specific version (e.g. v
x.y.z) to the
@system set packages¶
@profile set packages¶
@world set packages¶
Emerge a package outside of the
@worldset (as if it is a dependency):
Remove package from the
@worldset without rerunning
Packages can support having multiple versions installed simultaneously. This is useful for libraries which may have changed interfaces between versions. This feature is called slotting.
Most packages have no need for slotting. These packages specify
SLOT="0". This is not the same as
specifying an empty slot (
SLOT=""), an empty slot means "disable slotting entirely", and should
not be used.
Print available slots of a package:
Install a previous version of a package:
# revdep-rebuild -v # check for and rebuild missing libraries # equery d package_name # print packages that depend on a specific package # equery g --depth=1 package_name # print dependencies of a specific package # equery f --tree package_name # print installed files by a specific package # eix package_name # get information about a package # e-file vim # tells wich not installed package provides a commdand (e.g. vim) # equery b 'wich vim' # tells which installed package provides a command # emerge -e @world # requests to reinstall everything you asked the package manager to have on the system, and everything that is needed, directly or indirectly, by those things (if a package is not listed, it is because it is no longer needed): see <https://forums.gentoo.org/viewtopic-t-1088610-start-0.html>
If this cheat sheet has been useful to you, then please consider leaving a star here.