Gentoo Linux: Update Profile
Gentoo Profile Upgrade instructions
Note 1: The use of binary packages is completely optional, and also not as much tested as the source-based upgrade path yet. If you prefer to only use the traditional source-based installation, omit the “–getbinpkg” parameter in all emerge invocations.
Note 2: If you have manually changed your CHOST to a value different from what the stages and profiles set, you may have to do that in the future too. In that case you should know what you are doing, hopefully; please read the instructions with a critical eye then.
-
Ensure your system backups are up to date. Please also update your system fully and depclean before proceeding. glibc older than 2.36 and musl older than 1.2.4 is not supported anymore.
-
If you are still using one of the long-deprecated amd64 17.0 profiles (other than x32 or musl), then first complete the migration to the corresponding 17.1 profile. Instructions can be found at [3].
-
If you are currently using systemd in a split-usr configuration, then first complete the migration to the corresponding merged-usr profile of the same profile version. Details on how to do this can be found in the news item [4].
If you are currently using openrc, migrate to 23.0 first, keeping your disk layout. If you want to move from split-usr to merged-usr, do that afterwards.
- Run
emerge --info"
and note down the value of the CHOST variable.
-
Edit /etc/portage/make.conf; if there is a line defining the CHOST variable, remove it. Also delete all lines defining CHOST_… variables.
-
Select the 23.0 profile corresponding to your current profile, either using “eselect profile” or by manually setting the profile symlink.
Note that old profiles are by default split-usr and the 23.0 profiles by default merged-usr. Do NOT change directory scheme now, since this will mess up your system!
Instead, make sure that the new profile has the same property: for example,
OLD default/linux/amd64/17.1
==> NEW default/linux/amd64/23.0/split-usr
(added "split-usr")
OLD default/linux/amd64/17.1/systemd/merged-usr
==> NEW default/linux/amd64/23.0/systemd
(removed "merged-usr")
A detailed table of the upgrade paths can be found at [5]. Please consult it. In some cases (hppa, x86) the table will tell you to pick between two choices. What you need should be obvious from your old CHOST value (from step 4).
- Delete the contents of your binary package cache at ${PKGDIR}
rm -r /var/cache/binpkgs/*
-
In the file or directory /etc/portage/binrepos.conf (if existing), update the URI in all configuration such that they point to 23.0 profile binhost directories. The exact paths can be found in the table at [5], too.
-
Rebuild or reinstall from binary (if available) the following packages in this order, with the same version as already active:
emerge --ask --oneshot sys-devel/binutils
(you may have to run binutils-config and re-select your binutils now)
emerge --ask --oneshot sys-devel/gcc
IMPORTANT: If this command wants to rebuild glibc first, do not let it do that; instead, abort and try again with –nodeps added to the command line.) (you may have to run gcc-config and re-select your gcc now) and the C library, i.e. for glibc-based systems
emerge --ask --oneshot sys-libs/glibc
or for musl-based systems
emerge --ask --oneshot sys-libs/musl
-
Re-run “emerge –info” and check if CHOST has changed compared to step 4. If the CHOST has NOT changed, skip to step 13 (env-update). Otherwise,
-
Recheck with binutils-config and gcc-config that valid installed versions of binutils and gcc are selected.
-
Check /etc/env.d, /etc/env.d/binutils, and /etc/env.d/gcc for files that refer to the OLD CHOST value, and remove them. Examples how to do this can be found in the similar procedure at [6].
-
Run
env-update && source /etc/profile
- Re-emerge libtool:
emerge --ask --oneshot libtool
- Just for safety, delete the contents of your binary package cache at ${PKGDIR} again:
rm -r /var/cache/binpkgs/*
- Rebuild world:
emerge --ask --emptytree @world
- improved version of this emerge to save time
emerge --ask --emptytree --exclude "sys-devel/gcc sys-devel/binutils sys-libs/glibc \
sys-kernel/linux-firmware sys-kernel/gentoo-sources sys-kernel/linux-headers \
sys-apps/baselayout dev-build/libtool" @world
- more improved version \o/
- additionally excludes binary packages, groups and virtual packages
emerge -eav --keep-going --exclude "gcc glibc binutils libtool linux-firmware \
linux-headers gentoo-sources intel-microcode baselayout \
$(qlist -IC -- -bin) $(qlist -IC acct-) $(qlist -IC virtual/)" @world
...
Checking for at least 6600 MiB disk space at "/var/tmp/portage/www-client/firefox-128.4.0-r1/temp"
...
>>> Emerging (1 of 1662) sys-devel/gnuconfig-20240728::gentoo
* gnuconfig-20240728.tar.xz BLAKE2B SHA512 size ;-) ...
>>> Unpacking source...
>>> Unpacking gnuconfig-20240728.tar.xz to /var/tmp/portage/sys-devel/gnuconfig-20240728/work
>>> Source unpacked in /var/tmp/portage/sys-devel/gnuconfig-20240728/work
>>> Preparing source in /var/tmp/portage/sys-devel/gnuconfig-20240728/work ...
>>> Source prepared.
...
- then recompile the kernel, if you want to