Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 30598  / 1 Year ago, fri, november 18, 2022, 6:30:17

I have installed Apt-Cacher NG to provide a cache of packages for several machines. I therefore see no point in having aptitude/apt-get keeping their own (second) cache in /var/cache/apt/archives. I realise I can empty this cache with sudo apt-get clean, but is there some way of configuring apt-get to automatically clean the cache when an install has completed?


More From » apt

 Answers
4

According to the documentation you can add a config file to /etc/apt/apt.conf.d/ named no-cache containing Dir::Cache ""; and Dir::Cache::archives ""; according to manual of apt.conf. There is a bug report raising issues with this method, and I don't recommend it.



There is one remaining method according to this tutorial:



echo 'DPkg::Post-Invoke {"/bin/rm -f /var/cache/apt/archives/*.deb || true";};' | sudo tee /etc/apt/apt.conf.d/clean


This will carry out an rm command just before apt quits.


[#41924] Sunday, November 20, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
huovie

Total Points: 234
Total Questions: 99
Total Answers: 105

Location: Central African Republic
Member since Sun, Feb 26, 2023
1 Year ago
huovie questions
Mon, Aug 2, 21, 01:46, 3 Years ago
Thu, Feb 2, 23, 10:58, 1 Year ago
Thu, Oct 21, 21, 08:55, 3 Years ago
Sun, Dec 5, 21, 23:57, 2 Years ago
;