feature request: apt-get update --if-necessary
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
In many cases (juju, lxc containers .. ) we find ourselves in the position of not knowing if the apt-cache has been udpated recently. So, you either risk not doing it, or do it and it takes some time and generates load.
so long story short, you always run 'apt-get update' which is quite often
unnecessary.
Would it be possible to add (or is there now) something like
'--if-necessary' or '--if-necessary
look at /var/lib/apt/lists and check timestamps on files for each url that
/etc/apt/
reasonably recent, then it would not do the update.
There exist other solutions to this like:
https:/
https:/
It'd be nice if we had a sane way to say:
update if you need to, otherwise don't waste time and resources
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: apt 1.0.9.3ubuntu1
ProcVersionSign
Uname: Linux 3.19.0-7-generic x86_64
ApportVersion: 2.16.2-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Mar 6 17:06:22 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-01-02 (63 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20150101)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)
Just realized, that ideally 'apt-get update' would respect headers that were put in place by the source. azure.archive. ubuntu. com/ubuntu/ dists/vivid/ Release -O /dev/null 51294baae5400"
$ wget -S -q http://
HTTP/1.1 200 OK
Date: Tue, 31 Mar 2015 13:32:55 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Tue, 31 Mar 2015 12:28:00 GMT
ETag: "34f32-
Accept-Ranges: bytes
Content-Length: 216882
Cache-Control: max-age=0, proxy-revalidate
Expires: Tue, 31 Mar 2015 13:32:55 GMT
Keep-Alive: timeout=5, max=100
Ie, by default apt-get should not bother pulling that again until the 'Expires' date. Subsequent 'apt-get update' would just skip it, unless told '--force' or some thing. Such a policy would drastically reduce load (and traffic on mirrors or original mirrors).