Little Known Facts
Published on 26 Feb 2004Tags #gentoo
Some basic facts about gentoo.
Using emerge to install, upgrade and remove package
Installing: emerge PACKAGE
Upgrading: emerge -u PACKAGE or emerge -U PACKAGE
Removing: emerge -C PACKAGE
Importance of pretending
The above command can take a long time to complete or even leave your system in an unusable state. It is, therefore, recommended to verify that emerge is about to perform what you want instead of what you said.
(use the --pretend or -p option)
Updating vs upgrading only
There are two distinct methods of upgrading your system:
-
Updating will install the latest stable version of the package which may result in a downgrade. (use the
--updateor-uoption) -
This method will also install the latest stable version of a package but will not result in a downgrade. (use the
--upgradeonlyor-Uoption)
Special package names
There are (at least) two special package names:
systemdenotes packages that are essential for operationworlddenotes all installed packages (/var/cache/edb/world)
Limitation of updating/upgrading world
When issuing the above command emerge -u world, only those packages which are listed in the world file and their direct dependencies are checked for updates although the full dependency tree may contain packages for which an update is available. To ensure that all packages in the full dependency tree of all packages in the world file are checked for update, use:
emerge -uD world
Handling specific versions
In case you need to work with a specific version of a package: emerge '=CATEGORY/PACKAGE-VERSION'
Installing untested package
The following command allows installing untested package: ACCEPT_KEYWORDS="~x86" emerge PACKAGE. Be warned that those package are not extensively tested for Gentoo and may damage your system. See also masked vs ~arch.
Important customizable locations
-
PKGDIR(default:/usr/portage/packages). This is the location where binary packages are stored byemerge. See also binary packages. -
DISTDIR(default:/usr/portage/distfiles). Stores your distfiles outside of/usr/portage. One reason is discussed in emerge rsync from behind a firewall. -
PORTDIR_OVERLAY. Because of the fact that modifications in/usr/portageget reversed duringemerge rsync, the specified path holds a custom portage tree.
Maintenance tools
etc-update
rc-update
env-update
update-modules
gcc-config
java-config