Secondary Package Management With Pacman

Want to try out new software but also keep your system clean of packages that you do not use? Unless you keep good track of everything you install for a trial, you are likely to leave some unwanted packages on your system at some stage. Not that they generally do anything apart from take disk space (at least on Arch Linux), until one day when you are doing an update and you think “What is that package doing on my system?”.

One way I have found to keep track of packages you want to temporarily install is to have a sort of secondary package management system within the main pacman database. This is achieved through abuse of the dependency tracking features of pacman. Any package that is to be installed for a temporary period get installed with the --asdep flag. This tells pacman that the package is a dependency. Given no other package depends on it, it is what is commonly referred to as an “orphan” package and can be listed using pacman -Qtd. Currently on my system I have:

$ pacman -Qtd
gimp 2.6.11-6
vlc 1.1.10-6

When I no longer want these packages on my system, they will be uninstalled in the standard way (pacman -Rs pkg). If I decide to keep the package, I can change the pacman database entry using the little known -D/--database flag. E.g. pacman -D --asexplicit vlc will change the install reason for the vlc package from being “Installed as a dependency for another package” to “Explicitly installed”. It will no longer be listed as an orphan, effectively taking it out of this secondary pacman management system inserting it into the main one.

3 thoughts on “Secondary Package Management With Pacman

  1. On my system after I do pacman -Qtd I get:

    apache 2.2.19-1
    aria2 1.12.1-1
    bzr 2.3.4-1
    cloog-ppl 0.15.10-2
    cndrvcups-common 2.00-1
    cyrus-sasl-gssapi 2.1.23-7
    cyrus-sasl-ldap 2.1.23-7
    cyrus-sasl-sql 2.1.23-7
    dri2proto 2.6-1
    dropbox 1.1.35-1
    eggdbus 0.6-6
    git 1.7.6-1
    glproto 1.4.14-1
    gtkimageview 1.6.4-1
    ipod-sharp 0.8.5-1
    lib32-db 5.1.19-1
    lib32-libdrm 2.4.26-1
    lib32-lzo2 2.03-1
    lib32-opencdk 0.6.6-1.1
    lib32-openssl-compatibility 0.9.8-4
    libbeagle 0.3.9-2
    libgraphite 2.3.1-1
    libgsf 1.14.21-1
    libgtkhtml 2.11.1-3
    liboil 0.3.17-1
    libxfontcache 1.0.5-1
    libxxf86misc 1.0.2-1
    linux-atm 2.5.1-2
    nickle 2.70-1
    perl-date-manip 6.23-1
    perl-locale-gettext 1.05-7
    perl-math-round 0.06-4
    perl-net-smtp-ssl 1.01-2
    perl-php-serialization 0.27-2
    perl-soap-lite 0.712-3
    perl-timedate 1.20-2
    perl-unicode-map 0.112-2
    perl-xml-sax 0.96-3
    perl-xyne-common 2011.02.03.3-2
    php 5.3.6-5
    pyopenssl 0.12-1
    pyrex 0.9.9-2
    python-chardet 2.0.1-4
    python-distribute 0.6.19-1
    python-pypdf 1.13-1
    python-rsvg 2.32.0-6
    qt3 3.3.8-20
    raptor1 1.4.21-3
    rpcbind 0.2.0-3
    rpmextract 1.0-4
    ruby-gettext 2.1.0-4
    scons 2.0.1-1
    subversion 1.6.17-6
    vbetool 1.1-1
    xcursor-bisigi 0.3-1
    xcursor-themes 1.0.3-1
    xmlto 0.0.24-1
    xorg-apps 7.6-1
    xorg-xkb-utils 7.6-1
    xulrunner 5.0-1
    yaourt 0.10.1-2
    yasm 1.1.0-1

    Its weird that some of them appear there, take dropbox for example, I installed it from aur using yaourt (yaourt also appears there) I am sure I installed yaourt manually and not as a dependency, also there are other apps here that dont appear orphan to me at all (like subversion, qt3, php).

    So this brings some questions to mind, should I take this package list with a grain of salt? how foolproof is this method, how does a explicitly installed package from AUR makes its way to this list?

    thanks for the post 😀

    • Well… foolproof and yaourt never go together… I’d alter the database entries for the packages you think should be kept from that list using “pacman -D –asexplicit <pkg>”.