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.

Summary
Please do read the rest of this page in detail if you're struggling, but the gist is:
 * 1) Try to do a world upgrade, obviously, but that's probably failed given you're here.
 * 2)  (see below for why this is so important, but make a note of what tree state you were in beforehand from ).
 * 3) Try to upgrade Portage by itself:
 * 4) If that fails due to Python related bits, try:
 * 5) If that fails due to Python related bits, try:

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 hitting 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.