Selected-packages set (Portage)

From Gentoo Wiki
Jump to:navigation Jump to:search

The selected-packages set contains the user-selected "world" packages that are listed in the /var/lib/portage/world file.

Managing the selected-packages set

Listing the selected-packages set

eix can be used to list the selected-packages set:

user $eix -c --selected-file

Emerge a package without adding it to the world file

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.

root #emerge --ask --oneshot <category/atom>

Checking the world file

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% [============================================>]

Keeping the world file clean

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

CODE Check world file bash example
#!/bin/bash

world_file='/var/lib/portage/world'
deselect='/tmp/deselect'

while read package ; do
    printf "${package}: "
    check=$(qdepends -Q ${package} 2>&1)
    if [[ -n ${check} ]]; then
        if [[ ${check} == *'no matches found'* ]]; then
            printf "No matches found for your query\n"
        else
            emerge_check=$(emerge -p --quiet --depclean ${package} 2>&1)
            if [[ -n ${emerge_check} ]]; then
                printf "Needs to stay in @world\n"
            else
                printf "Can be deselected\n"
                printf "${package}\n" >> ${deselect}
            fi
        fi
    fi
done < ${world_file}

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. See the next section for details.

Adding an atom without recompilation

To add a package to the selected-packages set without recompiling the package:

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

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

See also

External resources