Skip to navigation
Gentoo Cheat Sheet
02.09.17
Package management Sync methods Sync all repositories that are set to auto-sync including the Gentoo ebuild repository: root #emaint -a sync Sync the Gentoo ebuild repository using the mirrors by obtaining a snapshot that is (at most) a day old: root #emerge-webrsync Sync custom package repository and the Gentoo ebuild repository using eix: root #eix-sync app-portage/eix can be installed by issuing: root #emerge -a eix Gather more information on eix by reading its manual: user $man eix Package installation and removal In the following tips www-client/firefox will be used as an example, substitute Firefox with the package of interest to perform the actions on another package. List what packages would be installed without installing them: root #emerge -pv www-client/firefox Install a specific version of a package (Use '\=' if your shell attaches meaning to '='): root #emerge =www-client/firefox-24.8.0 Install a package but excluding it from the world file: root #emerge --oneshot www-client/firefox or root #emerge -1 www-client/firefox Remove a package that no other packages depend on: root #emerge -cav www-client/firefox Remove a package even if it is needed by other packages: root #emerge -C www-client/firefox Warning Use with caution. This can break software. Best if used to temporarily remove to satisfy a hard block. Remove packages no longer needed: root #emerge -av --depclean As a safety measure, depclean will not remove any packages unless all required dependencies have been resolved. As a consequence of this, it often becomes necessary to run: root #emerge --update --newuse --deep @world Avoid unnecessary rebuilds when USE flags only get added to or dropped from the repository: root #emerge --update --changed-use --deep @world Package upgrades Upgrade all installed packages, dependencies, and deep dependencies that are outdated or have USE flag changes (avoiding unnecessary rebuilds when USE changes have no impact): root #emerge -uDU --keep-going --with-bdeps=y @world Package troubleshooting Check for and rebuild missing libraries: root #revdep-rebuild -v equery is part of app-portage/gentoolkit. You can obtain it by issuing this command: root #emerge -a gentoolkit Tell which installed package provides a command using equery: user $equery b `which vim` Tell which packages depend on a specific package (cat/pkg in the example) using equery: user $equery d www-client/firefox Get information about a package using eix: root #eix www-client/firefox Portage enhancements A graphical user interface to use with the Portage tree: root #porthole Manage configuration changes after an emerge completes: root #dispatch-conf After installations or updates Rebuilds packages that depend on an recently updated library: root #revdep-rebuild After updating perl-core packages: root #perl-cleaner --all For haskell packages: root #haskell-updater For python packages: root #python-updater USE flags Obtain descriptions and usage of the USE flag X using euse: user $euse -i X Gather more information on euse by reading its manual page: user $man euse Obtain a description of the png USE flag: user $euse -i | grep png Show what packages have the mysql USE flag: user $equery hasuse mysql Show what packages are currently built with the mysql USE flag: user $eix --installed-with-use mysql Show what USE flags are available for a specific package: user $equery uses
Quickly add a required USE flag for a package install: root #echo 'dev-util/cmake -qt4' >> /etc/portage/package.use Important Portage files[i 1] /etc/portage/make.conf - Global settings (USE flags, compiler options). /etc/portage/package.use - USE flags of individual packages. Can also be a folder containing multiple files. /etc/portage/package.accept_keywords - Keyword individual packages; e.g. ~amd64, ~x86, or ∼arm. /etc/portage/package.license - Accepted licenses /var/lib/portage/world - List of explicitly installed package atoms. /var/db/pkg - Contains for every installed package a set of files about the installation. Log management genlop genlop is a Portage log processor, also estimating build times when emerging packages. Install genlop by issuing: root #emerge -a app-portage/genlop You can gather more information on app-portage/genlop by reading its manual page: root #man genlop View the last 10 emerges (installs): root #genlop -l | tail -n 10 View how long emerging LibreOffice took: root #genlop -t libreoffice Estimate how long emerge -uND --with-bdeps=y @world will take: root #emerge -pU @world | genlop --pretend Watch the latest merging ebuild during system upgrades: root #watch genlop -unc Services Obtain root shell (if the current user is listed in the sudoers list): user $sudo -s OpenRC Start the ssh daemon in the default runlevel at boot: root #rc-update add sshd default Start the sshd service now: root #rc-service sshd start Check if the sshd service is running: root #rc-service sshd status systemd Start the ssh daemon at boot: root #systemctl enable sshd Start the sshd service now: root #systemctl start sshd Check if the sshd service is running: root #systemctl status sshd
http://myridia.com/dev_posts/view/1808
Reply
Anonymous
Information Epoch 1732664642
Don't do anything the computer can do for you.
Home
Notebook
Contact us