Cache is no longer pruned by default

Bug #21283 reported by Hidde Brugmans
6
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Medium
Michael Vogt

Bug Description

For internet files for instance it is quite normal to have settings to set the
maximum cache size, and rules for clearing that cache, for instance files more
than X days old.

Currently there does not seem to be such a thing for apt, save for the "leave"
"clear after download" and "clear now" options that synaptic offers.

I just held a quick poll in #ubuntu-nl, and I was the one with the smallest
/var/cache/apt/archives

hidde@system:~$ du -sm /var/cache/apt/archives
562 /var/cache/apt/archives

That's 562mb, for the record.
Now I know how to clean it, and with my fancy fast hardware, I can't be bothered
much.
The story changes however when people dist-upgrade on 5-20gb laptops.

Revision history for this message
Matt Zimmerman (mdz) wrote :

See /etc/cron.daily/apt

Revision history for this message
Matt Zimmerman (mdz) wrote :

These seem to be the defaults in cron.daily:

    MaxAge=0
    MinAge=2
    MaxSize=0

This will cause files never to be expired. Did you change this in your recent
updates to the script? We should definitely be expiring by default.

Revision history for this message
Michael Vogt (mvo) wrote :

$ cat /etc/apt/apt.conf.d/20archive
APT::Archives::MaxAge "30";
APT::Archives::MinAge "2";
APT::Archives::MaxSize "500";

We expire by default and the default settings are the ones above. Can please
tell me if that file has different values for you or if for some reason anacron
is not run on your system?

Cheers,
 Michael

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #3)
> $ cat /etc/apt/apt.conf.d/20archive
> APT::Archives::MaxAge "30";
> APT::Archives::MinAge "2";
> APT::Archives::MaxSize "500";
>
> We expire by default and the default settings are the ones above. Can please
> tell me if that file has different values for you or if for some reason anacron
> is not run on your system?

OK, I forgot (or didn't notice) that you'd placed defaults in another file.

I have the same default values, and my apt cache (as usual) is a reasonable
size. I override two of these values in apt.conf:

APT::Archives::MaxAge "7";
APT::Archives::MaxSize "5120";

So it's working for me, but I'm not using the default configuration either

Revision history for this message
Michael Vogt (mvo) wrote :

After some irc talk with the bug reporter I'm not sure that this is a bug and
not a misunderstanding.

Hidde, could you please check if it really is a problem (e.g. by repolling on
#ubuntu-nl about:
$ du -sh /var/cache/apt/archives
$ find /var/cache/apt/archives -mtime +30 -and -ctime +30

and if that does not match the values they have set in there apt configuration.

(I lower the severity because I'm pretty sure that the script/defaults are
working for most people so I don't think it's a major problem).

Revision history for this message
Hidde Brugmans (hcbrugmans-deactivatedaccount) wrote :

Micheal

I'll check, but I'm indeed pretty convinced it was a misunderstanding.

Revision history for this message
Michael Vogt (mvo) wrote :

As disucussed on irc this is probably a misunderstanding and not a bug. I close
it now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.