[Apt-cacher-ng-users] Expiration wants to delete almost all packages

Eduard Bloch edi at gmx.de
Sat May 14 12:36:14 UTC 2016


Hallo,
* Eduard Bloch [Sun, May 08 2016, 12:41:43PM]:
> Hallo,
> * Tim Edwards [Sat, May 07 2016, 05:38:45PM]:
> 
> > I'm guessing apt-cacher-ng doesn't support this? I can't find a way to
> > turn it off though.
> > https://wiki.ubuntu.com/AptByHash
> > 
> 
> The by-hash implementation is the most likely reason. I need to extend
> the code to move the stuff correctly in the cache (todo ASAP, probably
> in the next days).
> 
> There is a way to turn it off but it is a brutal one.
> 
> /usr/lib/apt-cacher-ng/acngtool cfgdump | grep =.*by.hash > /etc/apt-cacher-ng/zzz_temp_override.conf
> 
> And then edit the new file and remove the "by-hash" strings there, or
> better change them to NOBYHASH or something. Don't forget to remove the
> file when proper support is available.

Version 0.9.2 has a stop-gar solution for this problem now.
It still needs more work, to support two additional things:

a) identify latest version from by-hash file set and install them into
target location (i.e. reuse the data where needed)

b) in cases where multiple download mirrors are configured and the first
one is missing hashed files, it might switch to another one and try
there instead of returning 404 (which would make APT fall back to legacy
scheme). However, this algorithm needs to be properly tuned; hopping
through the list until the last mirror is tried is probably less
efficient that just returning 404 after a couple of attempts. Or try
around until the last mirror is accessed. But it's also error-prone, I
guess people are configuring the mirror list in order of preference and
the last one might be the least reliable one, and might be not
accessible when needed.

Not sure which strategy to implement here. If someone has specific
wishes, please reveal them.

<more brainstorming>

In case this strategy would be configured, there is also the question
where to do it in the config. Since it would act similar to the current
keyfile option, but which parameters are needed? Maybe something like:

hashmissrotation=50% # try download from alternative mirrors for 404-Not-Found errors until half of available mirrors are tried, then report 404 to caller and stay on that mirror for the remaining downloads for this client connection

Any opinions?

Best Regards,
Eduard.

-- 
Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen.
		-- Heinrich Heine



More information about the Apt-cacher-ng-users mailing list