How do I clear the cache created by running apt-file update?
Also, is there a way to see how much space the cache is currently using?
Asked
Active
Viewed 2,817 times
1 Answers
-1
Refer post: https://www.computerhope.com/unix/apt-file.htm & https://wiki.debian.org/apt-file
apt-file purge
Purge the user cache. An apt-file update will be needed before a search can be performed on the user cache. If the user cache doesn't exist, the system-wide cache can be used for user searches.
Purge
Clear "Contents-" files from the apt-file cache directory. If you receive any errors listing or searching, it's a good idea to perform a purge and then an update.
To delete the system wide cache use:
sudo apt-file purge
related directories:
~/.cache/apt-file
/var/cache/apt/apt-file
Ajay
- 678
- 1
- 5
- 16
-
2I'm not sure when, but at some point the `purge` action was removed. For example it is present in [Ubuntu Trusty 14](http://manpages.ubuntu.com/manpages//trusty/man1/apt-file.1.html) but not in [Ubuntu Focal 20](http://manpages.ubuntu.com/manpages/focal/en/man1/apt-file.1.html) – Jet Blue Aug 10 '20 at 03:55
-
Try removing cache files using sudo rm . Some thing like given on the same page http://manpages.ubuntu.com/manpages/focal/en/man1/apt-file.1.html. – Ajay Aug 10 '20 at 05:28
-
1Neither of the two directories you shared are present in my system (Focal). Perhaps the new version of `apt-file` shares the cache info with `apt`. [This line](http://manpages.ubuntu.com/manpages/focal/en/man1/apt-file.1.html) in the docs makes me think so: _"The apt-file command relies on the APT configuration. Notably, the default configuration makes `apt` fetch Contents files by default during a call to `apt update`."_ – Jet Blue Aug 10 '20 at 21:22
-
I think this answer is not valid for Ubuntu since it does not support purging in its apt-file version. – Thomas Mar 26 '21 at 09:20