We’ve synced the portage tree before upgrading our old portage package (big mistake! always upgrade the portage package before sync) and then do the sync. After the sync the portage upgrade was impossible, because a dependency package supported only a new portage API (probably a new package) in our case EAPI 7 and the offensive package was “app-eselect/eselect-pinentry“.
So there are two options:
- Find the last version of the portage,which does not depend on the package – app-eselect/eselect-pinentry
- Find if some of the USE flags disable the inclusion of this dependency – app-eselect/eselect-pinentry
We chose the second option and found that if we compiled the portage package with
-rsync-verify
the portage did not pull the dependency “app-eselect/eselect-pinentry” and then after a successful upgrade we had the portage supported EAPI 7 and reinstalled it with activated “-rsync-verify”.
Here is the error:
root@srv ~ # emerge -vu portage These are the packages that would be merged, in order: Calculating dependencies... done! !!! All ebuilds that could satisfy "app-eselect/eselect-pinentry" have been masked. !!! One of the following masked packages is required to complete your request: - app-eselect/eselect-pinentry-0.7::gentoo (masked by: EAPI 7) The current version of portage supports EAPI '6'. You must upgrade to a newer version of portage before EAPI masked packages can be installed. (dependency required by "app-crypt/pinentry-1.1.0-r2::gentoo" [ebuild]) (dependency required by "app-crypt/gnupg-2.2.10::gentoo" [ebuild]) (dependency required by "sys-apps/portage-2.3.58::gentoo[-build,rsync-verify]" [ebuild]) (dependency required by "portage" [argument]) For more information, see the MASKED PACKAGES section in the emerge man page or refer to the Gentoo Handbook.
Here is how to resolve the issue fast as described above:
root@srv ~ # USE="-rsync-verify" emerge -vu portage These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild U ] dev-python/pyblake2-1.1.2::gentoo [0.9.3-r1::gentoo] PYTHON_TARGETS="python2_7 python3_4 python3_5* python3_6* -pypy -pypy3% -python3_7%" 124 KiB [ebuild U ] sys-apps/portage-2.3.58::gentoo [2.3.13-r1::gentoo] USE="(ipc) native-extensions xattr -build -doc -epydoc -gentoo-dev% -rsync-verify% (-selinux) (-linguas_ru%)" PYTHON_TARGETS="python2_7 python3_4 python3_5* python3_6* -pypy -python3_7%" 995 KiB Total: 2 packages (2 upgrades), Size of downloads: 1,119 KiB >>> Verifying ebuild manifests >>> Running pre-merge checks for sys-apps/portage-2.3.58 * Determining the location of the kernel source code ..... .....
The build was successful and we had the portage supporting EAPI 7 packages.
Then we rebuild the package without the extra USE above, so the default “rsync-verify” was included and its multiple dependencies as you can see:
root@srv ~ # emerge -v portage These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild N ] app-crypt/openpgp-keys-gentoo-release-20190102::gentoo USE="-test" 50 KiB [ebuild N ] dev-libs/npth-1.6-r1::gentoo USE="-static-libs" 294 KiB [ebuild N ] app-eselect/eselect-lib-bin-symlink-0.1.1::gentoo 45 KiB [ebuild N ] app-eselect/eselect-pinentry-0.7::gentoo 0 KiB [ebuild U ] dev-libs/libgpg-error-1.32-r1::gentoo [1.27-r1::gentoo] USE="nls -common-lisp -static-libs" ABI_X86="(64) -32 (-x32)" 884 KiB [ebuild N ] dev-libs/libassuan-2.5.1-r1::gentoo USE="-static-libs" 552 KiB [ebuild N ] dev-libs/libksba-1.3.5-r2::gentoo USE="-static-libs" 607 KiB [ebuild N ] dev-python/bz2file-0.98::gentoo PYTHON_TARGETS="python2_7 -pypy" 12 KiB [ebuild N ] app-crypt/pinentry-1.1.0-r3::gentoo USE="ncurses -caps -emacs -fltk -gnome-keyring -gtk -qt5 -static" 457 KiB [ebuild N ] virtual/logger-0-r1::gentoo 0 KiB [ebuild N ] mail-mta/nullmailer-2.0-r2::gentoo USE="ssl -test" 244 KiB [ebuild N ] virtual/mta-1::gentoo 0 KiB [ebuild N ] app-crypt/gnupg-2.2.12::gentoo USE="bzip2 nls readline smartcard ssl -doc -ldap (-selinux) -tofu -tools -usb -user-socket -wks-server" 6,526 KiB [ebuild N ] app-portage/gemato-14.0::gentoo USE="blake2 bzip2 gpg -lzma -sha3 -test -tools" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6 -pypy -python3_7" 70 KiB [ebuild R ] sys-apps/portage-2.3.58::gentoo USE="(ipc) native-extensions rsync-verify* xattr -build -doc -epydoc -gentoo-dev (-selinux)" PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6 -pypy -python3_7" 0 KiB Total: 15 packages (1 upgrade, 13 new, 1 reinstall), Size of downloads: 9,735 KiB >>> Verifying ebuild manifests >>> Running pre-merge checks for sys-apps/portage-2.3.58 ..... .....
Everything was built smoothly and we upgraded the portage package successfully!
Note
Just to note most of the time the first option is better or even the only one, which could be used: “Find the last version of the portage,which does not depend on the package”. Even sometimes it could make yourself looking for an older portage ebuild file or older portage trees (if you have backup somewhere).