Take the 2-minute tour ×

I'm using Arch Linux, with its Pacman package manager. I want to keep my system as clean as possible, and that includes not having any unused packages installed. But, because of dependencies, it's not a trivial task to have zero of such, at least with my level of knowledge. Is there any tool available, console or GUI, that will show me all installed packages that nothing depends on?

share|improve this question

3 Answers 3

up vote 6 down vote accepted

From the Arch Wiki:

$ pacman -Qdt

Or, to recursively remove orphans:

orphans() {
    echo "No orphans to remove."
    sudo pacman -Rs $(pacman -Qdtq)
share|improve this answer
I don't trust scripts when it comes to deleting ;P Anyway, thanks. –  Xirdus Dec 4 '12 at 22:10
Fair enough: pacman will print a list of the packages for deletion, seeking your confirmation; so it is not entirely Russian Roulette... –  jasonwryan Dec 4 '12 at 22:11

pacman -Qt prints packages whose doesn't need on system (maybe you need it). I hope I didn't misunderstand you.

share|improve this answer
The -t switch displays packages that are not required by another package, but this will obviously include stand-alone packages; you should combine it with the -d switch for a better picture of "orphaned" packages--which is what I assume the OP means by "unused packages." –  jasonwryan Dec 4 '12 at 21:49
I know but it wasn't unequivocal for me what Xirdus wants. –  uzsolt Dec 5 '12 at 9:37

You usually want to see a list of end-user programs you have installed:

pacman -Qte

where t lists the end nodes of the dependency graph (the packets not required by other installed packets) and e filters out only explicitly installed packages.

If you always forget what these programs are for (like I do), try:

pacman -Qtei | grep -P "Name|Description"

After uninstalling, use

pacman -Rs $(pacman -Qqtd)

To remove all orphan packages

Last idea taken from Pacman Tips.

share|improve this answer

Your Answer


