To clean the cache and the databases of uninstalled packages, pacman has #pacman -Sc command. pacman does not offer the chance to keep a number of past versions of packages. Keeping these past versions, eliminates the need of downloading them again when you have to downgrade perhaps. The default number is 3 versions of the package.
I use #paccache -rk command to help in cleaning the cache. The default is 3 versions of the package is retained. What about uninstalled packages? Well you can use #paccache -ruk0 command to remove all cache for uninstalled packages. And that's what I did. Only I forgot the -u switch. The -u switch limits the scope of the paccache command on uninstalled packages only. I just removed about 5 GB of cache and database from /var/cache/pacman/pkg/ . This mistake prevents me from 1)downgrading a packages without the need to retrieve it from the archives and 2)easily reinstalling a package from the cache folder if I need to.
Well, lesson learned.
Comments