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-1.9.2.2-2-x86_64.pkg.tar.xz', 'xulrunner-1.9.2.3-1-x86_64.pkg.tar.xz', 'xulrunner-1.9.2.4-1-x86_64.pkg.tar.xz', 'xulrunner-1.9.2.6-1-x86_64.pkg.tar.xz', 'xulrunner-1.9.2.7-1-x86_64.pkg.tar.xz', 'xulrunner-1.9.2.8-1-x86_64.pkg.tar.xz', 'xulrunner-1.9.2.9-1-x86_64.pkg.tar.xz', 'xulrunner-1.9.2.10-1-x86_64.pkg.tar.xz']


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: