Tuesday, 9 November 2010

Cache_clean to clean up older packages

I have a 10 gig / partition and I had only about a gig left on it. So, I decided to clean up. I was aware that pacman stores multiple versions of packages so I checked out the size of /var/cache/pacman/pkg and it tuned out to be 4.9 gigs, i.e. more than 50% of my used space. The way to regain disk space was clear. I started looking up ways to clean up and found a python script in AUR. A snippet of the script's preview run is below.

['mercurial-1.5.1-1-x86_64.pkg.tar.xz', 'mercurial-1.5.2-1-x86_64.pkg.tar.xz', 'mercurial-1.5.3-1-x86_64.pkg.tar.xz', 'mercurial-1.5.4-1-x86_64.pkg.tar.xz', 'mercurial-1.6-1-x86_64.pkg.tar.xz', 'mercurial-1.6.2-1-x86_64.pkg.tar.xz', 'mercurial-1.6.3-1-x86_64.pkg.tar.xz']
['xulrunner-', 'xulrunner-', 'xulrunner-', 'xulrunner-', 'xulrunner-', 'xulrunner-', 'xulrunner-', 'xulrunner-']

Using the script I cleaned 2.5 gb within a minute. Elegant.
[N.B. - An alternative script in Go is available at github.]

No comments: