Switching a Gentoo profile changes the defaults that Portage uses for USE flags, package masks, system and profile sets, toolchain policy, and binary package matching. Use a normal profile switch when the system is staying on the same profile generation but needs a different role, such as moving from a base profile to a desktop subprofile.
The active profile is the /etc/portage/make.profile symlink, and eselect profile lists valid targets from the synced Gentoo ebuild repository. The list marks the current target with *, while emerge --info shows the profile that Portage uses for dependency calculations.
Stay on the same profile generation unless a Gentoo news item says to perform a profile update. Switching to a newer generation, changing split-usr versus merged-usr, moving between OpenRC and systemd, or changing ABI families can require extra migration steps beyond a simple profile selection.
Related: How to sync the Gentoo repository
Related: How to read Gentoo news items
Related: How to update the Gentoo system profile
Related: How to update a Gentoo world set
$ sudo emaint --auto sync >>> Syncing repository 'gentoo' ... >>> Sync completed for gentoo
Profile targets come from the local ebuild repository under /var/db/repos/gentoo/profiles, so a stale repository can hide new profiles or keep removed profiles visible.
Related: How to sync the Gentoo repository
$ sudo eselect news list News items: [1] N 2024-03-22 Profile upgrade to version 23.0 available
If the news item announces a new profile generation or split-usr/merged-usr migration, follow the migration instructions instead of treating it as a normal same-generation switch. Related: How to update the Gentoo system profile
$ eselect profile show Current /etc/portage/make.profile symlink: default/linux/amd64/23.0
Keep the old profile path until the rebuild is complete so a bad selection can be corrected without guessing the previous target.
$ sudo emerge --ask --verbose --update --deep --newuse @world These are the packages that would be merged, in order: Calculating dependencies... done! ##### snipped #####
Resolve blockers while the old profile is still active. A normal profile switch should start from a system that already updates cleanly.
Related: How to update a Gentoo world set
$ sudo emerge --ask --depclean Calculating dependencies... done! >>> No packages selected for removal by depclean
Do not proceed if depclean proposes removing packages that still provide boot, login, network, compiler, or desktop functionality you depend on.
$ eselect profile list Available profile symlink targets: [1] default/linux/amd64/23.0 * [2] default/linux/amd64/23.0/desktop [3] default/linux/amd64/23.0/desktop/gnome [4] default/linux/amd64/23.0/desktop/plasma [5] default/linux/amd64/23.0/systemd ##### snipped #####
Use the number shown by the command you just ran. Profile numbers can change when the repository profile list changes.
$ sudo eselect profile set 2
The example selects the same-generation desktop profile from the list above. Choose the target that matches the system role, architecture, libc, init system, and usr layout.
$ eselect profile show Current /etc/portage/make.profile symlink: default/linux/amd64/23.0/desktop
If the path is wrong, run sudo eselect profile set <number> again before rebuilding packages.
$ sudo emerge --ask --verbose --update --deep --newuse @world These are the packages that would be merged, in order: Calculating dependencies... done! ##### snipped #####
Stop and follow the relevant Gentoo documentation if the target profile changes toolchain family, libc, ABI, init system, hardened policy, SELinux policy, or profile generation. Those transitions can need extra package rebuilds and configuration cleanup.
$ sudo emerge --ask --depclean Calculating dependencies... done! >>> No packages selected for removal by depclean
depclean recalculates against the new system, world, and profile sets, so the removal list may differ from the pre-switch check.
$ sudo env-update >>> Regenerating /etc/ld.so.cache...
$ source /etc/profile
Opening a new terminal or logging in again has the same practical effect for normal shell sessions.
$ emerge --info Portage 3.0.79 (default/linux/amd64/23.0/desktop, gcc-15, glibc-2.42-r7, 6.12.76-gentoo x86_64) ================================================================= ##### snipped ##### USE="X acl alsa cups dbus gtk ipv6 qt6 udev wayland" ##### snipped #####
The profile path in emerge --info should match the profile selected with eselect.