In case you want to build some Gentoo packages on different operating system.
Could theoretically be a good package manager for an project with many dependencies.
- Gentoo
- Gentoo:Prefix (https://wiki.gentoo.org/wiki/Project:Prefix)
https://www.gentoo.org/news/2025/02/20/gentoo-qcow2-images.html
- visit https://www.gentoo.org/downloads/
- download QCOW2 disk (no root pw) [no multilib | systemd] image
#!/bin/sh
# https://distfiles.gentoo.org/releases/amd64/autobuilds/20250322T105044Z/di-amd64-console-20250322T105044Z.qcow2
version=20250322T105044Z
ssh_port=30022
# https://www.qemu.org/docs/master/system/index.html
qemu-system-x86_64 \
-m 8G -smp 4 -cpu host -accel kvm -vga virtio -smbios type=0,uefi=on \
-drive if=pflash,unit=0,readonly=on,file=/usr/share/edk2/OvmfX64/OVMF_CODE_4M.qcow2,format=qcow2 \
-drive file=di-amd64-console-${version}.qcow2 \
-net nic -net user,hostfwd=tcp::${ssh_port}-:22 \
-name "gentoo-vm-dev" &
root
- (no password)
- guest:
10.0.2.15
- host:
10.0.2.2
nano /etc/ssh/sshd_config
PermitRootLogin yes
PermitEmptyPasswords yes
systemctl enable sshd
systemctl start sshd
ssh (from host): ssh -p 20022 root@localhost
See also https://wiki.gentoo.org/wiki/Gentoo_Cheat_Sheet)
https://wiki.gentoo.org/wiki/Gentoo_Binary_Host_Quickstart
nano /etc/portage/make.conf
FEATURES="getbinpkg"
getuto
- note: may take a while
NOTE: some binary packages may not meet current USE flags requirements. e.g.:
!!! The following binary packages have been ignored due to non matching USE:
=net-libs/nghttp2-1.65.0-r1 -systemd
=net-libs/nghttp2-1.65.0-r1 -systemd xml
=net-libs/nghttp2-1.65.0-r1 xml
To fix this just add desired flags to package override.
nano /etc/portage/package.use/my-binpkg-flags
net-libs/nghttp2 xml
emerge --sync -q
- sync portage and overlaysemerge -uUD world -vp
- update all packages (optional)emerge app-portage/eix app-shells/gentoo-bashcomp -q
eix-update
- update eix database
- by name:
eix something
- by description:
eix -S something
- compact list:
eix -c -I something_installed
eselect profile list
- this will show available profiles, current
no-multilib
profile marked with*
- this will show available profiles, current
eselect profile set 22
- this will set multilib profile similar to currently used one
emerge -1 sys-kernel/gentoo-kernel binutils util-linux -q
- just in case
nano /etc/portage/package.use/my-multilib
sys-libs/ncurses abi_x86_32
- then
emerge -1 sys-libs/ncurses -q
https://wiki.gentoo.org/wiki/Eselect/Repository
emerge app-eselect/eselect-repository -q
eselect repository add test git https://github.com/test/test.git
emaint sync -r test
eix -c --in-overlay test
- just for examplenano /etc/portage/package.accept_keywords/my-unstable-pkgs
- To use unstable or unkeyworded packages:
- for unstable just add package name:
dev-util/test-pkgname::test
or=dev-util/test-pkgname-1.2.3::test
- for unkeyworded and 9999 add
**
at the end:dev-util/test-pkgname::test **
- for unstable just add package name:
- To use unstable or unkeyworded packages:
nano /etc/portage/package.use/my-multilib
dev-util/test-pkgname::test abi_x86_32
- if you also want 32bit support
emerge dev-util/test-pkgname::test -q
quickpkg dev-util/test-pkgname
- use e.g. rsync to download it on host from
/var/cache/binpkgs/dev-util/test-pkgname/*
rsync -r -e 'ssh -p 20022' root@localhost:/var/cache/binpkgs/dev-util/test-pkgname/* .
- repeat with package dependencies if needed