Gentoo
Portage
Directories
The default ebuild folder is /var/db/repos/gentoo/
The package.mask file is is at /var/db/repos/gentoo/profiles/package.mask
Portage stores source files in /var/cache/distfiles/
The standard directory for documentations is /usr/share/doc/
Explicitly installed packages are listed in /var/lib/portage/world
The common configuration file for merging is at /etc/portage/make.conf
Cheat sheet
Action | Command |
---|---|
Update the repository | emerge --sync |
Search for software | emerge --search [keyword] emerge --searchdesc [keyword] |
Install software | emerge --ask gui-wm/sway |
Check dependencies | emerge --pretend sway |
Only download sources | emerge --fetchonly sway |
View USE flags | emerge -vp gui-wm/sway |
Mark package as removable | emerge --deselect sway |
Update installed packages | emerge --update --ask @world |
+ their dependencies | --deep |
+ their build dependencies | --with-bdeps=y |
+ account for USE changes | --newuse |
Remove deselected/unneeded packages | emerge --depclean --ask |
Query a variable | portageq envvar USE |
List all installed packages | portageq match / "" |
Updating packages
Update the repository with emerge --sync
, then emerge --update --ask @world
Removing unneeded packages
Manually deselect the packages to remove with emerge --deselect
, or make the desired changes to USE flags
Update with dependencies: emerge --update --deep --newuse --ask @world
Remove unneeded packages: emerge --depclean --ask
Accepting licenses
A package's license will be shown by results of emerge --search
The ACCEPT_LICENSE
variable is defined in /etc/portage/make.conf
Acceptance of licenses for individual packages can be done in /etc/portage/package.license
Individual licenses are stored in /var/db/repos/gentoo/licenses/
License groups are stored in var/db/repos/gentoo/profiles/license_groups
License Group | Summary |
---|---|
@GPL-COMPATIBLE | GPL, BSD, MIT, Apache-2.0, zlib, unicode, ... |
@FSF-APPROVED | Apache-1.0, openssl, IBM, PHP-3.01, ... |
@OSI-APPROVED | GPL, BSD, MIT, zlib, ... |
@MISC-FREE | Unapproved but follow the Free Software Definition |
@FREE-SOFTWARE | @FSF-APPROVED + @OSI-APPROVED + @MISC-FREE |
@FSF-APPROVED-OTHER | "free documentation" or "works of practical use besides software and documentation" |
@MISC-FREE-DOCS | Not listed under @FSF-APPROVED-OTHER but still follow the free definition |
@FREE-DOCUMENTS | @FSF-APPROVED-OTHER + @MISC-FREE-DOCS |
@FREE | @FREE-SOFTWARE + @FREE-DOCUMENTS |
@BINARY-REDISTRIBUTABLE | At the very least allows free redistribution in binary form |
@EULA | Tries to take away your rights |
Network
The hostname is defined at /etc/conf.d/hostname
# hostname hostname="oldboy"
You can define several fields under /etc/conf.d/net
# dns domain name dns_domain_lo="home" # ip interface config_eno1="192.168.1.141 netmask 255.255.255.0 brd 192.168.1.255" routes_eno1="default via 192.168.1.1"
Linux
Fonts are in /usr/share/fonts/
Update environment variables for the current session with env-update
and source /etc/profile
Find all available modules by running
find /lib/modules/`uname -r` -type f -iname '*.o' -or -iname '*.ko'
Find all detected CPU vulnerabilities by running
tail -n +1 /sys/devices/system/cpu/vulnerabilities/*
To load modules automatically on boot, list them in /etc/modprobe.d/*.conf
files.
Configure the kernel with make menuconfig
Build the kernel by doing make -j5 && make modules_install -j5
OpenRC
To add a service to a runlevel (sysinit, boot, default):
rc-update add <service_name> <runlevel>
To manage a service (start, stop, restart):
rc-service <service_name> <command>