[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Reducing the size of apt-caches



On Wed, Sep 06, 2006 at 11:43:50PM +0200, Robert Buchholz wrote:
> Hi,
> 
> I wonder how the size of the apt-cache is reduced in the original KNOPPIX?
> 
> $ ls -lah /var/cache/apt
> ...
> -rw-r--r--  1 root root 863K  2. Jun 13:21 pkgcache.bin
> -rw-r--r--  1 root root  52K  2. Jun 13:21 srcpkgcache.bin
> 
> After extracting the 5.0.1 knoppix for remastering and installing one
> package (!), the files have grown pretty much:
> 
> -rw-r--r--  1 root root  13M 2006-09-06 22:36 pkgcache.bin
> -rw-r--r--  1 root root  13M 2006-09-06 22:31 srcpkgcache.bin
> 
> Is there a safe way to reduce them back into a region where the original
> files were?
> 
> ( I did try apt-cache regen but that did not lead anywhere. )

I usually do a

for i in $(find /var/lib/apt/lists -type f \( -name \*Packages -o -name \*Sources \) 2>/dev/null); do  :>"$i"; done
dpkg --clear-avail
rm -f /var/cache/apt/*.bin
apt-cache gencaches

for having just the INSTALLED packages listed in the database. his can
be important especially for the CD version, where space is tight.

Regards
-Klaus Knopper



Reply to: