User:Feng/World file (Portage)

From Gentoo Wiki
Jump to:navigation Jump to:search

The world set, also referred to as @world in Portage development, encompasses the system set and the selected set.

Packages belonging to the world set are listed by default into the /var/lib/portage/world file.

It is the world file, together with the profile and /etc/portage (including make.conf) settings, that defines what software is installed on a system.

Later, when a world update is requested (through emerge -uDN @world or similar command), Portage will use the world file as the base for its update calculations.


The emaint command can be used to see if any problems exist in the world file:

user $/usr/sbin/emaint --check world
Emaint: check world 100% [============================================>]

Keep it clean

In order to avoid problems in dependency resolution when updating the system, the /var/lib/portage/world file should contain as few dependencies as possible. So use the --oneshot (-1) option for emerging dependencies.

The application qdepends has several known bugs. In particular, see the bug #390749.

Dependencies already listed in this file can be found using the qdepends -Q command and be collected in a file say /tmp/deselect:

The following script may have several issues so check the data carefully.[1]
CODE checkworldfile

while read i ; do \
        if [ -n "$(qdepends -Q $i)" ]; then \
                echo '' ; echo 'checking '$i ; 
                if [ -n "$(emerge -p --quiet --depclean $i)" ]; then \
                        echo $i' needs to stay in @world'
                        echo $i' can be deselected' 
                        echo $i >> /tmp/deselect
done < /var/lib/portage/world

Entries collected in /tmp/deselect can be cross-checked using the --depclean option:

user $emerge -pv --depclean $(< /tmp/deselect)

The emerge --deselect option will remove these entries without unmerging them.

root #emerge --ask --deselect $(< /tmp/deselect)

In case emerge --depclean -p indicates some needed or wanted package would be unmerged, those can be re-added using the --noreplace option:

root #emerge --ask --noreplace <atom>

It will add the atom to the /var/lib/portage/world file without compiling it again.

See also

External resources