To save bandwidth and data on my Internet plan, I have installed squid-deb-proxy on a desktop, and the client on it and a few other machines I've got. However, based on the post that put me onto this , it sounds like if I take my laptop* to a different network and update it there, the downloaded updates will NOT be automatically copied back to the squid-deb-proxy server when I get back on my network.
Assuming that this is correct (I will be testing later), is there a way I can stick these packages into the cache so I don't have to download them one more time for other machines in the network?
* As noted in the comments, I could simply make the laptop the proxy server, but in my specific case, the laptop is actually 1) a VM that is not running all the time, 2) in a laptop that is not open all the time. As such, that solution, while a good one, does not work in my case.
You could use
apt-move
(from the package of the same name) to create a local apt repository from the files in your laptop's apt cache. Then usersync
to keep a synced copy of this repository on your LAN. Finally, point other LAN machines to your LAN copy of the local repository at the top ofsources.list
, so that apt prefers the local repository over remote ones.This still is an incomplete answer, but it might be the best possible answer, so read on if curious about possible partial/ugly/complicated solutions.
Intriguing question, I've encountered the same problem but I never fixed it, instead I just try to limit my apt-getting outside my local lan. It really wasn't worth the hassle, at most I wasted like 20MB over the last year. My iso torrent seeding makes up for that. But!
you could set up a tunnel/proxy between your laptop and home to utilize your home cache (this is a good idea anyway for privacy reasons), but, then you would be dependant on your upload speed. Not only would that be slow, but you would use 2x the bandwidth to download the same thing. 1x going into your lan from the Ubuntu mirrors and 1x out to the coffee shop.
I propose that it may be possible to run the cache server on your laptop and then use rsync to keep it in sync with your home server. This presents a problem however in that when you are home that server on your laptop will still be running. To deal with that I could see two possibilities. 1. stop the cache server on your laptop while at home 2. keep all the cached copies that exist on your home server on your laptop too (extra space requirements) and accomplish this by not only pushing cached data to your server with when you get home with rsync, but also regularly pulling the cached data down to your laptop server. In suggesting this I have made the assumption that the squid-deb-proxy cache on one server is compatible with another and that you can swap files in and out like that. These options will also certainly require some scripting. The cache for me is located at /var/cache/squid-deb-proxy/ and below that is not immediately human understandable.
We use a simple and stupid aproach: the squid-deb-proxy can use itself as a proxy. Therefore I just do:
I install the client software on the squid-deb-proxy Server:
apt-get install squid-deb-proxy-client
I created a simple script which lists all installed packages - and redownload each package:
This way we already have a not-so-bad basic cache.
If we would like to add all packages of an existing server to the cache, then we just execute the same procedure 1) and 2)