emerge – ERROR: 17.1 migration has not been performed – upgrade from 13 to 17.1

When upgrading to 17.1 profile you need to perform additional steps to get to a healthy Gentoo portage system using profile 17.1.
Here what we stumbled when we tried to upgrade from 13 to 17.1:

>>> Emerging (1 of 3) dev-libs/elfutils-0.177::gentoo
 * Fetching files in the background.
 * To view fetch progress, run in another terminal:
 * tail -f /var/log/emerge-fetch.log
 * elfutils-0.177.tar.bz2 BLAKE2B SHA512 size ;-) ...                                                                                                                [ ok ]
 * Please follow the instructions in the news item:
 * 2019-06-05-amd64-17-1-profiles-are-now-stable
 * or choose the 17.0 profile.
 * ERROR: dev-libs/elfutils-0.177::gentoo failed (setup phase):
 *   ERROR: 17.1 migration has not been performed!!
 * 
 * Call stack:
 *        ebuild.sh, line 591:  Called __source_all_bashrcs
 *        ebuild.sh, line 410:  Called __try_source '/usr/portage/profiles/default/linux/amd64/17.1/profile.bashrc'
 *        ebuild.sh, line 467:  Called __qa_source '/usr/portage/profiles/default/linux/amd64/17.1/profile.bashrc'
 *        ebuild.sh, line 112:  Called source '/usr/portage/profiles/default/linux/amd64/17.1/profile.bashrc'
 *   profile.bashrc, line   6:  Called die
 * The specific snippet of code:
 *              die "ERROR: 17.1 migration has not been performed!!"
 * 
 * If you need support, post the output of `emerge --info '=dev-libs/elfutils-0.177::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-libs/elfutils-0.177::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-libs/elfutils-0.177/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/elfutils-0.177/temp/die.env'.
 * Working directory: '/var/tmp/portage/dev-libs/elfutils-0.177/homedir'
 * S: '/var/tmp/portage/dev-libs/elfutils-0.177/work/elfutils-0.177'

As you can see there is news, which consists of 12 steps to perform a successful upgrade to profile 17.1.
You can read the news with (the news output is included at the end of this article, just for completeness):

eselect news read 28

Specific note for our upgrade – in fact, our Gentoo installation was a chroot and it had not been updated for three years. The profile was 13.0 and portage supported only EAPI 5, which is a real problem. The new portage tree (we installed the latest) has no profile 13.0 and our emerge was half broken. We have preliminary steps described in Failed to install sys-apps/portage – Called pkg_preinst – portage._compat_upgrade.default_locations

Because we upgrade from 13.0 to 17.1, first, we need to perform the 17.0 upgrade (check the original steps here – https://gentoo.org/support/news-items/2017-11-30-new-17-profiles.html)

STEP 1) Select the previous profile 17.0 temporarily.

srv ~ # eselect profile set default/linux/amd64/17.0

You won’t be able to build any GNU GCC and you cannot continue with the next step.

STEP 2) Upgrade to GNU GCC 6.4.0 or later.

Our current GNU GCC is really old – 4.9.3. The latest version is gcc-9.2.0-r1 and we are going to use it.

srv ~ # emerge -v gcc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS    ] sys-devel/gcc-9.2.0-r1:9.2.0::gentoo [4.9.3:4.9.3::gentoo] USE="(cxx) fortran (multilib) nls nptl openmp pch%* (pie%*) sanitize ssp%* vtv%* (-altivec) -d% -debug -doc (-fixed-point) -go -graphite (-hardened) (-jit) (-libssp) -lto% -objc -objc++ -objc-gc -pgo% -systemtap% -test% -vanilla (-awt%) (-cilk%) (-gcj%) (-multislot%) (-nopie%) (-nossp%) (-regression-test%)" 0 KiB

Total: 1 package (1 in new slot), Size of downloads: 0 KiB

>>> Verifying ebuild manifests
>>> Running pre-merge checks for sys-devel/gcc-9.2.0-r1
>>> Emerging (1 of 1) sys-devel/gcc-9.2.0-r1::gentoo
.....
.....
 * You might want to review the GCC upgrade guide when moving between
 * major versions (like 4.2 to 4.3):
 * https://wiki.gentoo.org/wiki/Upgrading_GCC

>>> sys-devel/gcc-9.2.0-r1 merged.
>>> Regenerating /etc/ld.so.cache...
srv ~ # gcc-config -l
 [1] x86_64-pc-linux-gnu-4.9.3 *
 [2] x86_64-pc-linux-gnu-9.2.0
srv ~ # gcc-config x86_64-pc-linux-gnu-9.2.0
 * Switching native-compiler to x86_64-pc-linux-gnu-9.2.0 ...
>>> Regenerating /etc/ld.so.cache...                                                                                                                                  [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   . /etc/profile

srv ~ # . /etc/profile
srv ~ # emerge -v --oneshot --usepkg=n sys-devel/libtool

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-devel/libtool-2.4.6-r5:2::gentoo [2.4.6:2::gentoo] USE="-vanilla" 951 KiB
[blocks B      ] <sys-apps/sandbox-2.10-r4 ("<sys-apps/sandbox-2.10-r4" is blocking sys-devel/libtool-2.4.6-r5)

Total: 1 package (1 upgrade), Size of downloads: 951 KiB
Conflict: 1 block (1 unsatisfied)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (sys-apps/sandbox-2.10-r1:0/0::gentoo, installed) pulled in by
    >=sys-apps/sandbox-2.2 required by (sys-apps/portage-2.3.76:0/0::gentoo, installed)
.....
.....
srv ~ # emerge -va sys-apps/sandbox

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-apps/sandbox-2.18::gentoo [2.10-r1::gentoo] USE="(-multilib%*)" ABI_X86="(32%*) (64%*) (-x32)" 418 KiB
.....
.....
srv ~ # emerge -v --oneshot --usepkg=n sys-devel/libtool 

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-devel/libtool-2.4.6-r5:2::gentoo [2.4.6:2::gentoo] USE="-vanilla" 951 KiB

Total: 1 package (1 upgrade), Size of downloads: 951 KiB

srv ~ # fix_libtool_files.sh 4.9
Scanning libtool files for hardcoded gcc library paths...
 *   [1/11] Scanning /lib ...
 *   [2/11] Scanning /usr/lib ...
 *   [3/11] Scanning /opt/intel/common/mdf/lib64 ...
 *   [4/11] Scanning /opt/intel/opencl ...
 *   [5/11] Scanning /lib32 ...
 *   [6/11] Scanning /lib64 ...
 *   [7/11] Scanning /usr/lib32 ...
 *   [8/11] Scanning /usr/lib64 ...
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libsupc++.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libquadmath.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libgomp.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libcaf_single.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libsupc++.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libquadmath.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libgomp.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libcaf_single.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libitm.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libatomic.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libgfortran.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libvtv.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/32/libgfortranbegin.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libitm.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libatomic.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libgfortran.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libvtv.la ...[]
 *     FIXING: /usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.3/libgfortranbegin.la ...[]
 *   [9/11] Scanning /usr/local/lib ...
 *   [10/11] Scanning /usr/local/lib32 ...
 *   [11/11] Scanning /usr/local/lib64 ...

srv ~ # emerge -va linux-headers binutils glibc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-kernel/linux-headers-5.3::gentoo [4.3::gentoo] USE="-headers-only%" 105,918 KiB
[ebuild  N     ] dev-libs/libunistring-0.9.10:0/2::gentoo  USE="-doc -static-libs" ABI_X86="(64) -32 (-x32)" 3,658 KiB
[ebuild  NS    ] sys-devel/binutils-2.32-r1:2.32::gentoo [2.25.1-r1:2.25.1::gentoo] USE="cxx gold%* nls plugins%* -default-gold% -doc% -multitarget -static-libs -test (-multislot%) (-vanilla%) (-zlib%*)" 20,431 KiB
[ebuild  N     ] net-dns/libidn2-2.2.0:0/2::gentoo  USE="-static-libs" ABI_X86="(64) -32 (-x32)" 2,062 KiB
[ebuild  NS    ] dev-lang/python-3.7.4-r1:3.7/3.7m::gentoo [2.7.16:2.7::gentoo, 3.4.3-r7:3.4/3.4m::gentoo] USE="gdbm ipv6 ncurses readline sqlite ssl xml -bluetooth% -build -examples -hardened -libressl -test% -tk -wininst (-threads%*)" 16,740 KiB
[ebuild     U  ] sys-libs/glibc-2.29-r5:2.2::gentoo [2.22-r4:2.2::gentoo] USE="audit%* gd* multiarch%* (multilib) (split-usr%*) ssp%* -caps% (-cet) -compile-locales% -doc% -headers-only% -nscd -profile (-selinux) -suid -systemtap -test% (-vanilla) (-crosscompile_opts_headers-only%) (-debug%) (-hardened%)" 18,528 KiB

Total: 6 packages (2 upgrades, 2 new, 2 in new slots), Size of downloads: 167,334 KiB
.....
.....
 * Messages for package sys-libs/glibc-2.29-r5:

 * Your //etc/nsswitch.conf is out of date.
 * Please make sure you have 'files' entries for
 * 'passwd:', 'group:' and 'shadow:' databases.
 * For more details see:
 *   https://wiki.gentoo.org/wiki/Project:Toolchain/nsswitch.conf_in_glibc-2.26
 * ERROR: sys-libs/glibc-2.29-r5::gentoo failed (pretend phase):
 *   nsswitch.conf has no 'files' provider in 'passwd'.
 * 
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.29-r5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.29-r5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.29-r5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.29-r5/temp/die.env'.
 * Working directory: '/var/tmp/portage/sys-libs/glibc-2.29-r5/homedir'
 * S: '/var/tmp/portage/sys-libs/glibc-2.29-r5/work/glibc-2.29'

Add “files” to your /etc/nsswitch.conf file and the lines should look like:

srv ~ # cat /etc/nsswitch.conf
.....
.....
passwd:      compat files
shadow:      compat files
group:       compat files
.....
.....

And continue with the glibc rebuild:

srv ~ # emerge -va linux-headers binutils glibc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] sys-kernel/linux-headers-5.3::gentoo [4.3::gentoo] USE="-headers-only%" 105,918 KiB
[ebuild  N     ] dev-libs/libunistring-0.9.10:0/2::gentoo  USE="-doc -static-libs" ABI_X86="(64) -32 (-x32)" 3,658 KiB
[ebuild  NS    ] sys-devel/binutils-2.32-r1:2.32::gentoo [2.25.1-r1:2.25.1::gentoo] USE="cxx gold%* nls plugins%* -default-gold% -doc% -multitarget -static-libs -test (-multislot%) (-vanilla%) (-zlib%*)" 20,431 KiB
[ebuild  N     ] net-dns/libidn2-2.2.0:0/2::gentoo  USE="-static-libs" ABI_X86="(64) -32 (-x32)" 2,062 KiB
[ebuild  NS    ] dev-lang/python-3.7.4-r1:3.7/3.7m::gentoo [2.7.16:2.7::gentoo, 3.4.3-r7:3.4/3.4m::gentoo] USE="gdbm ipv6 ncurses readline sqlite ssl xml -bluetooth% -build -examples -hardened -libressl -test% -tk -wininst (-threads%*)" 16,740 KiB
[ebuild     U  ] sys-libs/glibc-2.29-r5:2.2::gentoo [2.22-r4:2.2::gentoo] USE="audit%* gd* multiarch%* (multilib) (split-usr%*) ssp%* -caps% (-cet) -compile-locales% -doc% -headers-only% -nscd -profile (-selinux) -suid -systemtap -test% (-vanilla) (-crosscompile_opts_headers-only%) (-debug%) (-hardened%)" 18,528 KiB

Total: 6 packages (2 upgrades, 2 new, 2 in new slots), Size of downloads: 167,334 KiB
.....
>>> sys-libs/glibc-2.29-r5 merged.
>>> Regenerating /etc/ld.so.cache...
.....

Build the GNU GCC successfully, install the latest Linux headers and then rebuild glibc and binutils. You may rebuild GNU GCC again after glibc and gcc.

STEP 3) Proceed with the 17.1 migration steps.

There is a special migration tool app-portage/unsymlink-lib, which will fix multiple files, it will move and delete files. The “–analyze” option will show what will do the tool – mainly splitting files between /lib, /lib64, /usr/lib, /usr/lib64. Add python 3.6 to the make.conf file (because the unsymlink-lib uses python 3.6).

.....
PYTHON_TARGETS="python2_7 python3_6"
PYTHON_SINGLE_TARGET="python3_6"
.....

And install the migration tool “app-portage/unsymlink-lib”. There might be some slightly problems likes blocks by some packages as you can see below, just upgrade them and continue. In our installation only one package was the blocker – “x11-base/xcb-proto” (which triggered update of dev-lang/python-exec, too). Just update it and emerge again the “app-portage/unsymlink-lib”

srv ~ # emerge -1v app-portage/unsymlink-lib

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS    ] dev-lang/python-3.6.9:3.6/3.6m::gentoo [2.7.16:2.7::gentoo, 3.4.3-r7:3.4/3.4m::gentoo, 3.7.4-r1:3.7/3.7m::gentoo] USE="gdbm ipv6 ncurses readline sqlite ssl (threads%*) xml -bluetooth -build -examples -hardened -libressl -test -tk -wininst" 0 KiB
[ebuild     U *] dev-lang/python-exec-9999:2::gentoo [2.4.3:2::gentoo] PYTHON_TARGETS="(jython2_7) (pypy) (pypy3) (python2_7) (python3_5) (python3_6%*) (python3_7%*) (-python3_3%*) (-python3_4%*)" 0 KiB
[ebuild     U  ] dev-python/setuptools-41.2.0::gentoo [40.6.3::gentoo] USE="-test" PYTHON_TARGETS="python2_7 python3_6* -pypy -pypy3 -python3_5 -python3_7" 832 KiB
[ebuild     U  ] dev-python/certifi-2019.9.11::gentoo [2018.4.16::gentoo] PYTHON_TARGETS="python2_7 python3_6* -pypy -pypy3 -python3_5 -python3_7" 152 KiB
[ebuild   R    ] app-portage/gemato-14.1::gentoo  USE="blake2 bzip2 gpg -lzma -sha3 -test -tools" PYTHON_TARGETS="python2_7 python3_6* -pypy -python3_5 -python3_7" 0 KiB
[ebuild   R    ] sys-apps/portage-2.3.76::gentoo  USE="(ipc) native-extensions rsync-verify xattr -build -doc -epydoc -gentoo-dev (-selinux)" PYTHON_TARGETS="python2_7 python3_6* -pypy -python3_5 -python3_7" 0 KiB
[ebuild  N     ] app-portage/unsymlink-lib-17::gentoo  PYTHON_SINGLE_TARGET="python3_6 -python2_7 -python3_5 -python3_7" PYTHON_TARGETS="python2_7 python3_6 -python3_5 -python3_7" 11 KiB

Total: 7 packages (3 upgrades, 1 new, 1 in new slot, 2 reinstalls), Size of downloads: 993 KiB

!!! Multiple package instances within a single package slot have been pulled
!!! into the dependency graph, resulting in a slot conflict:

dev-lang/python-exec:2

  (dev-lang/python-exec-9999:2/2::gentoo, ebuild scheduled for merge) pulled in by
    >=dev-lang/python-exec-2:=[python_targets_pypy(-)?,python_targets_python2_7(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,python_targets_python3_7(-)?,-python_single_target_pypy(-),-python_single_target_python2_7(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-)] required by (app-portage/gemato-14.1:0/0::gentoo, ebuild scheduled for merge)
                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    >=dev-lang/python-exec-2:=[python_targets_pypy(-)?,python_targets_python2_7(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,python_targets_python3_7(-)?,-python_single_target_pypy(-),-python_single_target_python2_7(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-)] required by (sys-apps/portage-2.3.76:0/0::gentoo, ebuild scheduled for merge)
                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    >=dev-lang/python-exec-2:=[python_targets_pypy(-)?,python_targets_pypy3(-)?,python_targets_python2_7(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,python_targets_python3_7(-)?,-python_single_target_pypy(-),-python_single_target_pypy3(-),-python_single_target_python2_7(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-)] required by (dev-python/setuptools-41.2.0:0/0::gentoo, ebuild scheduled for merge)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
    >=dev-lang/python-exec-2:=[python_targets_pypy(-)?,python_targets_pypy3(-)?,python_targets_python2_7(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,python_targets_python3_7(-)?,-python_single_target_pypy(-),-python_single_target_pypy3(-),-python_single_target_python2_7(-),-python_single_target_python3_5(-),-python_single_target_python3_6(-),-python_single_target_python3_7(-)] required by (dev-python/certifi-2019.9.11:0/0::gentoo, ebuild scheduled for merge)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
    >=dev-lang/python-exec-2:=[python_targets_python2_7(-)?,python_targets_python3_5(-)?,python_targets_python3_6(-)?,python_targets_python3_7(-)?,-python_single_target_jython2_7(-),-python_single_target_pypy(-),-python_single_target_pypy3(-),python_single_target_python2_7(+)?,python_single_target_python3_5(+)?,python_single_target_python3_6(+)?,python_single_target_python3_7(+)?] required by (app-portage/unsymlink-lib-17:0/0::gentoo, ebuild scheduled for merge)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  (dev-lang/python-exec-2.4.3:2/2::gentoo, installed) pulled in by
    >=dev-lang/python-exec-2:2/2=[python_targets_python2_7(-),python_targets_python3_4(-),-python_single_target_python2_7(-),-python_single_target_python3_3(-),-python_single_target_python3_4(-),-python_single_target_python3_5(-)] required by (x11-base/xcb-proto-1.11:0/0::gentoo, installed)
                                                                                                                                                                                                                                                                                                                    


It may be possible to solve this problem by using package.mask to
prevent one of those packages from being selected. However, it is also
possible that conflicting dependencies exist such that they are
impossible to satisfy simultaneously.  If such a conflict exists in
the dependencies of two different packages, then those packages can
not be installed simultaneously.

For more information, see MASKED PACKAGES section in the emerge man
page or refer to the Gentoo Handbook.


The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by sys-apps/portage-2.3.76::gentoo
# required by app-portage/unsymlink-lib-17::gentoo
# required by app-portage/unsymlink-lib (argument)
=dev-lang/python-exec-9999 **
.....
.....
srv ~ # emerge -vu x11-base/xcb-proto

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] dev-lang/python-exec-2.4.6-r1:2::gentoo [2.4.3:2::gentoo] PYTHON_TARGETS="(jython2_7) (pypy) (pypy3) (python2_7) (python3_5) (python3_6%*) (python3_7%*) (-python3_3%*) (-python3_4%*)" 86 KiB
[ebuild  NS    ] dev-lang/python-3.6.9:3.6/3.6m::gentoo [2.7.16:2.7::gentoo, 3.4.3-r7:3.4/3.4m::gentoo, 3.7.4-r1:3.7/3.7m::gentoo] USE="gdbm ipv6 ncurses readline sqlite ssl (threads%*) xml -bluetooth -build -examples -hardened -libressl -test -tk -wininst" 0 KiB
[ebuild     U  ] x11-base/xcb-proto-1.13::gentoo [1.11::gentoo] ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7 python3_6%* -python3_5 -python3_7% (-python3_3%) (-python3_4%*)" 149 KiB

Total: 3 packages (2 upgrades, 1 in new slot), Size of downloads: 234 KiB
.....
.....
>>> x11-base/xcb-proto-1.13 merged.

>>> Recording x11-base/xcb-proto in "world" favorites file...
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

srv ~ # emerge -1v app-portage/unsymlink-lib

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U  ] dev-python/setuptools-41.2.0::gentoo [40.6.3::gentoo] USE="-test" PYTHON_TARGETS="python2_7 python3_6* -pypy -pypy3 -python3_5 -python3_7" 832 KiB
[ebuild     U  ] dev-python/certifi-2019.9.11::gentoo [2018.4.16::gentoo] PYTHON_TARGETS="python2_7 python3_6* -pypy -pypy3 -python3_5 -python3_7" 152 KiB
[ebuild   R    ] app-portage/gemato-14.1::gentoo  USE="blake2 bzip2 gpg -lzma -sha3 -test -tools" PYTHON_TARGETS="python2_7 python3_6* -pypy -python3_5 -python3_7" 0 KiB
[ebuild   R    ] sys-apps/portage-2.3.76::gentoo  USE="(ipc) native-extensions rsync-verify xattr -build -doc -epydoc -gentoo-dev (-selinux)" PYTHON_TARGETS="python2_7 python3_6* -pypy -python3_5 -python3_7" 0 KiB
[ebuild  N     ] app-portage/unsymlink-lib-17::gentoo  PYTHON_SINGLE_TARGET="python3_6 -python2_7 -python3_5 -python3_7" PYTHON_TARGETS="python2_7 python3_6 -python3_5 -python3_7" 11 KiB

Total: 5 packages (2 upgrades, 1 new, 2 reinstalls), Size of downloads: 993 KiB
.....
.....
>>> Installing (5 of 5) app-portage/unsymlink-lib-17::gentoo
 * checking 3 files for package collisions
>>> Merging app-portage/unsymlink-lib-17 to /
--- /usr/
--- /usr/bin/
>>> /usr/bin/unsymlink-lib -> ../lib/python-exec/python-exec2
--- /usr/lib/
--- /usr/lib/python-exec/
--- /usr/lib/python-exec/python3.6/
>>> /usr/lib/python-exec/python3.6/unsymlink-lib
--- /usr/share/
--- /usr/share/doc/
>>> /usr/share/doc/unsymlink-lib-17/
>>> /usr/share/doc/unsymlink-lib-17/README.bz2
>>> app-portage/unsymlink-lib-17 merged.
>>> Regenerating /etc/ld.so.cache...
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
srv ~ # unsymlink-lib --analyze
Analyzing files installed into lib & lib64...

directories that will be moved to /lib/:
        gentoo
        modprobe.d
        netifrc
        udev
        (+ 0 files)

directories whose contents will be split between /lib/ and /lib64/:

orphan dirs/files (not owned by any package) that will be moved to /lib/:
        cpp
        firmware
        modules

directories that will be moved to /usr/lib/:
        gcc
        grub
        portage
        python-exec
        python3.7
        systemd
        tmpfiles.d
        (+ 0 files)

directories whose contents will be split between /usr/lib/ and /usr/lib64/:

orphan dirs/files (not owned by any package) that will be moved to /usr/lib/:
        cracklib_dict.hwm
        cracklib_dict.pwd
        cracklib_dict.pwi
        libxslt-plugins

orphan dirs/files (not owned by any package) that will be kept in /usr/lib64/:
        libdb.a
        libdb.so
        libdb_cxx.a
        libdb_cxx.so
        libdb_sql.a
        libdb_sql.so
        libdb_stl.a
        libdb_stl.so
        libdrm.la
        libdrm.so
        libdrm.so.2
        libdrm.so.2.4.0
        libdrm_intel.la
        libdrm_intel.so
        libdrm_intel.so.1
        libdrm_intel.so.1.0.0
        libdrm_nouveau.la
        libdrm_nouveau.so
        libdrm_nouveau.so.2
        libdrm_nouveau.so.2.0.0
        libdrm_radeon.la
        libdrm_radeon.so
        libdrm_radeon.so.1
        libdrm_radeon.so.1.0.1
        libkms.la
        libkms.so
        libkms.so.1
        libkms.so.1.0.0
        libva-drm.la
        libva-drm.so
        libva-drm.so.1
        libva-drm.so.1.9900.0
        libva-glx.la
        libva-glx.so
        libva-glx.so.1
        libva-glx.so.1.9900.0
        libva-tpi.la
        libva-tpi.so
        libva-tpi.so.1
        libva-tpi.so.1.9900.0
        libva-x11.la
        libva-x11.so
        libva-x11.so.1
        libva-x11.so.1.9900.0
        libva.la
        libva.so
        libva.so.1
        libva.so.1.9900.0

directories that will be moved to /usr/local/lib/:
        (+ 0 files)

directories whose contents will be split between /usr/local/lib/ and /usr/local/lib64/:

orphan dirs/files (not owned by any package) that will be moved to /usr/local/lib/:
        pkgconfig

orphan dirs/files (not owned by any package) that will be kept in /usr/local/lib64/:
        libdispatch_shared.a
        libdispatch_trace.a
        libdrm.la
        libdrm.so
        libdrm.so.2
        libdrm.so.2.4.0
        libdrm_intel.la
        libdrm_intel.so
        libdrm_intel.so.1
        libdrm_intel.so.1.0.0
        libdrm_nouveau.la
        libdrm_nouveau.so
        libdrm_nouveau.so.2
        libdrm_nouveau.so.2.0.0
        libdrm_radeon.la
        libdrm_radeon.so
        libdrm_radeon.so.1
        libdrm_radeon.so.1.0.1
        libkms.la
        libkms.so
        libkms.so.1
        libkms.so.1.0.0
        libmfx.a


The state has been saved and the migration is ready to proceed.
To initiate it, please run:

        /usr/lib/python-exec/python3.6/unsymlink-lib --migrate

Please do not perform any changes to the system at this point.
If you performed any changes, please rerun the analysis.
srv ~ # /usr/lib/python-exec/python3.6/unsymlink-lib --migrate
[/lib32] & /lib -> /lib.new ...
[/usr/lib32] & /usr/lib -> /usr/lib.new ...
[/usr/local/lib32] & /usr/local/lib -> /usr/local/lib.new ...
Updating: /lib -> lib.new ...
Updating: /usr/lib -> lib.new ...
Updating: /usr/local/lib -> lib.new ...


Initial migration complete. Please now test whether your system works
correctly. It might be a good idea to try rebooting it. Once tested,
complete the migration and clean up backup files via calling:

        /usr/lib/python-exec/python3.6/unsymlink-lib --finish

If you wish to revert the changes, run:

        /usr/lib/python-exec/python3.6/unsymlink-lib --rollback
srv ~ # reboot

After the migration command reboot the machine, check if the portage is OK mainly the emerge command, but do not emerge anything! Just a working “emerge –info” is enough. And execute the migration tool with the “–finish”, which will delete multiple files (not only delete, there are move commands of files and directories and more). We have included the head and tail of our “–finish –pretend” command. “–pretend” will show what is going to be done, without executing real commands.

srv ~ # emerge --info
Portage 2.3.76 (python 2.7.16-final-0, default/linux/amd64/17.0, gcc-9.2.0, glibc-2.29-r5, 4.6.0-rc6 x86_64)
=================================================================
System uname: Linux-4.6.0-rc6-x86_64-Intel-R-_Xeon-R-_CPU_E3-1285_v4_@_3.50GHz-with-gentoo-2.2
KiB Mem:    15317464 total,  14918204 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 06 Oct 2019 02:00:01 +0000
Head commit of repository gentoo: d7e2de35de42266509bcb75d11aaaa5a77ba9090
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r2::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.16::gentoo, 3.4.3-r7::gentoo, 3.6.9::gentoo, 3.7.4-r1::gentoo
dev-util/cmake:           3.5.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.20.5::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15.1-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo, 2.32-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 9.2.0-r1::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r5::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 5.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r5::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -msse3 -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -msse3 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="7zip X a52 aac aalib acl addition amd64 amr apache2 audit bcmath berkdb bzip2 calendar cgi cli contentcache corefonts cracklib crypt ctype curl curlwrappers cxx dbi diskio djvu dri dts enchant encode exif extensible faac faad ffmpeg flac flv fontconfig fortran fpm ftp gd gdbm ggi gif gsm httpd iconv id64 ident imap imlib inode iproute2 ipv6 ithreads jack jemalloc jpeg jpeg2k json libcaca libtirpc lua mfd-rewrites mhash minizip mmx mmxext mp3 mpeg multilib mysql mysqli mysqlnd ncurses network nfsv41 nls nptl nptlonly ogg opencore-amr openipmi openmp openssl pam pcntl pcre pcre-jit pdo perl-geoipupdate php pkcs11 png python2_7 python3_1 rar readline rtmp rtsp sdl seccomp sftp sharedmem snmp soap sockets split-usr sqlite sqlite3 sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 status suhosin svg theora threads tiff truetype udev unicode v4l vhosts virtfs vorbis vpx x264 xattr xfs xml xmlreader xmlrpc xmlwriter xsl xvid zip zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog disk cpu network" CPU_FLAGS_X86="mmx mmxext sse sse2 avx avx2 fma3 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi fancyindex flv geoip headers_more lua mp4 perl realip secure_link stub_status limit_zone" OFFICE_IMPLEMENTATION="libreoffice" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="i386 x86_64 arm armeb" QEMU_USER_TARGETS="i386 x86_64 arm armeb" RUBY_TARGETS="ruby24 ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

srv ~ # unsymlink-lib --finish --pretend | wc -l
Those are the actions that would be performed:
14431
srv ~ # unsymlink-lib --finish --pretend
Those are the actions that would be performed:
mv -f -T /lib.new /lib
mv -f -T /usr/lib.new /usr/lib
mv -f -T /usr/local/lib.new /usr/local/lib
rm -rf -- /lib32
ln -s lib /lib32
rm -rf -- /usr/lib32
ln -s lib /usr/lib32
rm -d /lib64/gentoo/functions.sh
rm -d /lib64/gentoo
rm -d /lib64/modprobe.d/usb-load-ehci-first.conf
rm -d /lib64/modprobe.d
rm -d /lib64/cpp
rm -d /lib64/udev/rules.d/60-cdrom_id.rules
rm -d /lib64/udev/rules.d/75-net-description.rules
rm -d /lib64/udev/rules.d/60-persistent-storage-tape.rules
rm -d /lib64/udev/rules.d/80-net-name-slot.rules
rm -d /lib64/udev/rules.d/60-persistent-alsa.rules
rm -d /lib64/udev/rules.d/60-serial.rules
rm -d /lib64/udev/rules.d/90-network.rules
rm -d /lib64/udev/rules.d/60-block.rules
.....
.....
rm -d /usr/lib64/grub/i386-pc/true.module
rm -d /usr/lib64/grub/i386-pc/cmp.mod
rm -d /usr/lib64/grub/i386-pc/bitmap.module
rm -d /usr/lib64/grub/i386-pc/minix2_be.module
rm -d /usr/lib64/grub/x86_64-efi
rm -d /usr/lib64/grub/i386-pc
rm -d /usr/lib64/grub
rm -d /usr/lib64/libxslt-plugins
rm -d /usr/local/lib64/pkgconfig/libva.pc
rm -d /usr/local/lib64/pkgconfig/libdrm_nouveau.pc
rm -d /usr/local/lib64/pkgconfig/libkms.pc
rm -d /usr/local/lib64/pkgconfig/libdrm_radeon.pc
rm -d /usr/local/lib64/pkgconfig/libdrm_intel.pc
rm -d /usr/local/lib64/pkgconfig/libdrm.pc
rm -d /usr/local/lib64/pkgconfig/libva-x11.pc
rm -d /usr/local/lib64/pkgconfig/libva-drm.pc
rm -d /usr/local/lib64/pkgconfig/libva-tpi.pc
rm -d /usr/local/lib64/pkgconfig

srv ~ # unsymlink-lib --finish
Renaming /lib.new -> /lib ...
Renaming /usr/lib.new -> /usr/lib ...
Renaming /usr/local/lib.new -> /usr/local/lib ...
Removing: /lib32 ...
Updating: /lib32 -> lib ...
Removing: /usr/lib32 ...
Updating: /usr/lib32 -> lib ...
Removing stale files from /lib64 ...
Removing stale files from /usr/lib64 ...
Removing stale files from /usr/local/lib64 ...


Migration complete. Please switch to the new profiles, or add
the following to your make.conf (or equivalent):

        SYMLINK_LIB=no
        LIBDIR_x86=lib

Afterwards, please rebuild all installed GCC versions and all
packages installing into lib32, e.g.:

        emerge -1v /usr/lib/gcc /lib32 /usr/lib32

When the rebuilds are complete, the package manager should remove
the lib32 symlink. If it does not, do:

        rm /lib32 /usr/lib32

STEP 4) Select profile 17.1 and rebuild some packages.

First, it’s important to rebuild GNU GCC, “sys-devel/binutils” and glibc, then it is a good practice to rebuild the world slot (aka all installed applications despite we have not done it yet).

srv ~ # eselect profile set default/linux/amd64/17.1
srv ~ # emerge -1v =sys-devel/gcc-9.2.0-r1

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/gcc-9.2.0-r1:9.2.0::gentoo  USE="(cxx) fortran (multilib) nls nptl openmp pch (pie) sanitize ssp vtv (-altivec) -d -debug -doc (-fixed-point) -go -graphite (-hardened) (-jit) (-libssp) -lto -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
.....
.....
>>> sys-devel/gcc-9.2.0-r1 merged.
>>> Regenerating /etc/ld.so.cache...
srv ~ # emerge -1v sys-devel/binutils

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-devel/binutils-2.32-r1:2.32::gentoo  USE="cxx gold nls plugins -default-gold -doc -multitarget -static-libs -test" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
.....
.....
>>> Regenerating /etc/ld.so.cache...
>>> Original instance of package unmerged safely.
>>> sys-devel/binutils-2.32-r1 merged.
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.
srv ~ # emerge -1v sys-libs/glibc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-libs/glibc-2.29-r5:2.2::gentoo  USE="audit gd multiarch (multilib) (split-usr) ssp -caps (-cet) -compile-locales -doc -headers-only -nscd -profile (-selinux) -suid -systemtap -test (-vanilla)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
.....
.....
 *  (487/487) Generating zu_ZA.UTF-8 ...                                                                                                                              [ ok ]
 * Generation complete
 * Adding locales to archive ...                                                                                                                                      [ ok ]
~
>>> sys-libs/glibc-2.29-r5 merged.
>>> Regenerating /etc/ld.so.cache...
srv ~ # emerge -1v --deep /lib32 /usr/lib32 /usr/lib/llvm/*/lib32

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-apps/sandbox-2.18::gentoo  ABI_X86="(32) (64) (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
.....
.....

srv ~ # rm /lib32 /usr/lib32
rm: cannot remove ‘/usr/lib32’: No such file or directory

Remove /lib32 and /usr/lib32 if they still exists.
This is all you have to do to switch to Gentoo profile 17.1.

Leave a Reply

Your email address will not be published. Required fields are marked *