Bug#1018165: apt-update: make it possible to reliably tell when the apt cache was updated
Package: apt
Version: 2.2.4
Severity: wishlist
Tags: upstream
X-Debbugs-Cc: jakub.ruzicka@nic.cz
Debian users are supposed manually keep apt cache up to date by running
`apt update` but there is no reliable way to tell when the cache was
last updated.
As with any cache, the age of cached data is a fundamental information.
It's a very reasonable request to "update cache if it's old" but there
seems to be no way to do so reliably on Debian-based systems preventing
smooth automated operation.
This feature is available with most other package managers:
* Fedora's dnf updates cache automatically.
* Arch's pacman can update cache before package install with -y/--refresh.
Furthermore, many people are asking howto tell Debian apt cache age on
the internet:
* https://serverfault.com/questions/20747/find-last-time-update-was-performed-with-apt-get
* https://askubuntu.com/questions/410247/how-to-know-last-time-apt-get-update-was-executed
The best available solution (correct me if I'm wrong) is unreliable -
checking the timestamp of
/var/lib/apt/lists/
However, this doesn't update when there are no changes to package lists.
Please provide a way to reliably tell the last cache update time on any
distro using apt.
I suggest updating
/var/lib/apt/lists/last-update
or similar file's timestamp.
I'm happy to attempt to implement this change if someone experienced can
point out a proper way to do this.
Reply to: