Portage 管理
Portage 是 Gentoo Linux 特有的套件管理,頗具彈性。
emerge-webrsync
, fetch the latest portage snapshot from the mirrors.
emerge --info
可以看到目前的設定,如 USE, ALSA_CARDS, 等等。
eix -- Small utility for searching ebuilds with indexing for fast results
使用
eix firefox
--> search the packages 'firefox'
eix-update
--> generate cache
euses -- look up USE flag descriptions fast
USE 改變之後,看那些 package 需要重新 emerge。
emerge -av --update --newuse --deep @world
list the dependencies for a package
equery g krdc
gvfs mount point: /run/user/1000/gvfs/
Rebuild packages
revdep-rebuild -ip
或
emerge -av @preserved-rebuild
重新產生 digest
ebuild nvidia-drivers-100.14.11.ebuild digest
Portage TMPDIR on tmpfs
During emerge, you can build packages in tmpfs. Instead of having large build files in hdd. This speeds up emerge times and reduces hdd/ssd wearing.
You can mount /var/tmp to tmpfs with following config, 修改 /etc/fstab 如下
none /var/tmp/portage tmpfs size=2048M,noatime 0 0
然後 mount all partitions,如下
root # mount -a
Tmpfs should be big enough. When it gets full, emerge fails at that point. Most packages dont need much space but there are few very large packages. For example: app-office/openoffice: 10G or so. www-client/chromium: More than 2GB.
You can configure emerge to build large packages outside of the tmpfs drive. Create the file to tell portage where to place the temporary files directory.
建立 File /etc/portage/env/notmpfs.conf
PORTAGE_TMPDIR="/var/tmp/notmpfs"
Create the file in which you will list all the packages that need some special environment variable settings.
File /etc/portage/package.env
app-office/libreoffice notmpfs.conf
mail-client/mozilla-thunderbird notmpfs.conf
www-client/chromium notmpfs.conf
www-client/firefox notmpfs.conf
sys-devel/gcc notmpfs.conf