User:Sam/Portage help/Upgrading Portage

Background
Portage is Gentoo's main package manager.

For many years, Portage would always recommend updating itself before anything else. This ended up causing various problems when there was a "global Python target change" pending (e.g. PYTHON_TARGETS in the profiles changed from  to  ). Its behavior was later updated in to silence the message when such a change is detected.

The current version of portage supports EAPI '7'
Portage 3.0.20 and above supports EAPI 8, but earlier versions can't read ebuilds with this newer format specification.

Problem
The standard error looks like this when trying to upgrade :

Bash
See Project:Portage/Fixing_broken_portage if ihtting a Bash-related error.

PYTHON_TARGETS hack
First, run. If you see output like the following:

then it means that Python 3.8 is currently enabled, but will be disabled (say, due to a change in the profile defaults).

As a hack, we can force Portage to just update itself and minimize its dependencies by choosing the old Python version which was in use and turning off an optional feature (rsync-verify -- but that's why the sync was performed first) so that we get a version which supports EAPI 8.

Try the following:

Then proceed with trying to complete a world upgrade.

AttributeError: 'NoneType' object has no attribute 'ebuild'
The Portage version being used is buggy and it has broken after syncing the tree to a newer state. See the rescue Portage page.