[arch-general] Deleting packages

clemens fischer ino-news at spotteswoode.dnsalias.org
Wed Dec 7 14:47:13 EST 2011


Guillermo Leira wrote:

> I'm not a programmer, so I can't submit code, but it would be nice if
> pacman would say "Installed as a dependency of: package-name", or
> something similar. It's just a suggestion.

If a package is removed without its dependencies, those dependencies
also lose the pointer to the package that once pulled them in.  Note
that this relation is not hardcoded, which makes sense:  packages may
depend on others with a lower bound on the version needed, but any
version thereafter will do.  Nonetheless storing the "original" package
name+version could be done, maybe in an additional field to avoid the
need of updating the "dep: name+version" field each time a new
version is installed.

> Hummm... I'm seeing some pacman -R options that can be very useful to
> keep the system clean. Maybe I should have used it, and now I wouldn't
> have these "orphan" packages in my disk.

    pacman -Rs $(pacman -Qtdq)

The "s" means (from the man page):

    Remove each target specified including all of their dependencies,
    provided that (A) they are not required by other packages; and (B)
    they were not explicitly installed by the user. This operation is
    recursive and analogous to a backwards --sync operation, and helps
    keep a clean system without orphans. If you want to omit condition
    (B), pass this option twice.

You can make this even more aggressive by using "pacman -Rcs".

I used

    for i in $(pacman -Qtdq); do pacman -Rs $i;done

because there are packages I want to keep.  Without the for loop, pacman
will remove the whole bunch, with it I get the confirmer question one by
one.


clemens



More information about the arch-general mailing list