User:Vaukai/checkworldfile

From Gentoo Wiki
Jump to:navigation Jump to:search

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.

Checking

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.

CODE checkworldfile
#!/bin/bash

while read i ; do \
        if [ -n "$(qdepends -Qq $i)" ]; then \
                echo '' ; echo 'checking '$i ; 
                if [ -n "$(emerge -p --quiet --depclean $i)" ]; then \
                        echo $i' ok'
                else
                        echo $i' should be deselected' 
                fi
        fi 
done < /var/lib/portage/world

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

root #emerge --ask --deselect <package>

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 <package>

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

See also

External resources