Remove Files from /var/cache/apt (Not Archives) – How to

apt

I use Ubuntu 14.04 and I have a lot of files in /var/cache/apt (please note that they are NOT archives). I already ran aptitude autoclean but I think that this acts only on archives.

Can I simply remove the files like pkgcache.bin.02SUCA? I guess that pkgcache.bin and srcpkgcache.bin are important aren't they?

drwxr-xr-x  4 root root    20480 Dez  2 21:31 ./
drwxr-xr-x 22 root root     4096 Nov 22 22:40 ../
drwxr-xr-x  2 root root     4096 Jun 21 16:02 apt-file/
drwxr-xr-x  3 root root    53248 Dez  2 21:23 archives/
-rw-r--r--  1 root root 16368834 Dez  2 21:31 pkgcache.bin
-rw-r--r--  1 root root 25165824 Dez  2 20:26 pkgcache.bin.02SUCA
-rw-r--r--  1 root root 25165824 Dez  2 20:19 pkgcache.bin.03XpfC
-rw-r--r--  1 root root 25165824 Dez  2 20:19 pkgcache.bin.077hIh
-rw-r--r--  1 root root 25165824 Dez  2 20:19 pkgcache.bin.0bLboZ
-rw-r--r--  1 root root 25165824 Dez  2 20:19 pkgcache.bin.0EoDpq
-rw-r--r--  1 root root 25165824 Dez  2 20:32 pkgcache.bin.0mROye
... (goes on forever)

Best Answer

From Ubuntu Wiki

Apt stores two caches in /var/cache/apt/: srcpkgcache.bin is rather useless these days, and pkgcache.bin is only needed for faster lookups with apt-cache (software-center has its own cache). Removing those two buys 26 MB, for the price of apt-cache taking an extra two seconds for each lookup.

Hence, safe to remove