apt should be able to use an opportunistic cache/proxy

Bug #827627 reported by Hadmut Danisch
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Hi,

apt-get can use a HTTP proxy if on is configured in its settings, but then it fails if the proxy is unavailable.

Would be nice (and save ubuntu's server resources) if apt-get could use a proxy/cache opportunisticly, i.e. use it if available and access the repositories directly otherwise.

regards

Revision history for this message
Timothy Mayoh (timothy-m-deactivatedaccount) wrote :

Thank you for your suggestion. However, the changes you are requesting aren't really a bug and require more discussion, which should be done on an appropriate mailing list or forum. http://www.ubuntu.com/support/community/mailinglists might be a good start for determining which mailing list to use.

affects: ubuntu → apt (Ubuntu)
Changed in apt (Ubuntu):
status: New → Invalid
Revision history for this message
Timothy Mayoh (timothy-m-deactivatedaccount) wrote :

P.S. Apt already uses a cache if the package is available: /var/cache/apt

Revision history for this message
Brian Murray (brian-murray) wrote :

There is a package that provides a service like this it is called squid-deb-proxy-client.

Package: squid-deb-proxy-client
Priority: extra
Section: universe/net
Installed-Size: 60
Maintainer: Michael Vogt <email address hidden>
Architecture: all
Source: squid-deb-proxy
Version: 0.5.2
Depends: avahi-utils, apt (>= 0.7.25.3ubuntu1)
Filename: pool/universe/s/squid-deb-proxy/squid-deb-proxy-client_0.5.2_all.deb
Size: 3596
MD5sum: 2fb9ecdd480ab6ad6bcdc3081e33d7da
SHA1: d10218f4c9f5ca2e73e5bb58a7c37d77fac116a7
SHA256: 3f0f2fe107fca0f6716c6171ab0e0887216132ee33cf48a515c1b668027facb1
Description: Automatic proxy discovery for apt based on avahi
 This package contains a helper for the apt http method to discover
 proxies that publish their service as _apt_proxy._tcp.
 .
 It was written to be installed on clients that should use
 squid-deb-proxy automatically, but it will work with any proxy
 that publishes the service as _apt_proxy._tcp.
Homepage: https://launchpad.net/squid-deb-proxy
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Revision history for this message
Hadmut Danisch (hadmut) wrote :

squid-deb-proxy-client does not solve the problem since it does not work if there is no proxy available. It then returns an empty http://:

The construction via

Acquire::http::ProxyAutoDetect "/usr/share/squid-deb-proxy-client/apt-avahi-discover";

does not seem to allow empty answers, does it?

Revision history for this message
Hadmut Danisch (hadmut) wrote :

Oops, no, apt seems to accept that empty response...

Thanks for the hint.

Revision history for this message
Javier Domingo (txomon) wrote :

Hi, I would like to reopen this bug, as that package trusts any source it publishes itself as a proxy apt_mirror. I would like to see the optional caché feature implemented in apt, so that if we have something like apt-cacher-ng, we can rely that our computer will be updated thought it might not be available.

In the way of making just one optional proxy, I don't like trusting any server said to be a mirror, just mine or the official ones.

It would be nice to see this feature like configuring in /etc/apt/apt.conf an optional proxy like this:

Acquire::http::Proxy::Optional "http://192.168.2.233:3142";

Changed in apt (Ubuntu):
status: Invalid → New
Revision history for this message
Julian Andres Klode (juliank) wrote :

If that Acquire::http::ProxyAutoDetect thing works for that case, we should consider this bug to be invalid. I don't know anything about that particular option, though.

Revision history for this message
Javier Domingo (txomon) wrote :

that relies on an avahi implementation. I am using a much more simpler proxy, less dependant on other packages, apt-cacher-ng. There is a bug onto this: https://bugs.launchpad.net/ubuntu/+source/squid-deb-proxy/+bug/529897

The main problem for me is that I don't rely in other servers than mine, so I just want my mirror or nothing. Auto-detecting proxies wouldn't give me that option.

Revision history for this message
Torsten Spindler (tspindler) wrote :

There is a guide (untested by me) on how to setup a proxy if present and use DIRECT otherwise:
http://askubuntu.com/questions/53443/how-do-i-ignore-a-proxy-if-not-available

Does this solve the problem you describe in this bug?

Changed in apt (Ubuntu):
status: New → Incomplete
Revision history for this message
Hadmut Danisch (hadmut) wrote :

Well, not really solve, but workaround.

It works for home networks, but it's not suitable if you are in a large company network where you never know what other people are announcing and where you can't announce just what you want.

E.g. you cannot have client A uses cache B and client C uses cache D in the same network, and it's prone to attacks by faking caches.

Revision history for this message
Torsten Spindler (tspindler) wrote :

Wouldn't this be better solved via the proxies then, e.g. mimicking the squid-deb-proxy like avahi announcements through whatever means and discovering them via a ProxyAutoDetect string?

I'm not sure that apt itself should implement such a discovery mechanism.

Revision history for this message
Hadmut Danisch (hadmut) wrote :

No. apt itself should not implement a discovery service. But it should support another proxy directive where apt does not just die when the given cache is unavailabe, but just uses the next cache in the list or no cache at all as a fallback.

This is not about finding proxies.

This is about surviving the absence of a configured proxy, which is a completely different problem.

Revision history for this message
Torsten Spindler (tspindler) wrote :

Thanks for the clarification. I've marked this as a wishlist bug for now, as developer time for such a feature is limited.

Changed in apt (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → Wishlist
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.