Quantcast
Channel: sleeplessbeastie's notes
Viewing all articles
Browse latest Browse all 770

How to determine when the last time package index files were updated

$
0
0

Knowledge of how to determine when the last time package index files were updated can be very useful when you least expect it. It is not something used everyday, but can be used to monitor or verify when apt-get update command was executed.

The idea is very simple as it is based on the modification time of the most recently updated package index file located in /var/lib/apt/lists/ directory.

$ TZ="UTC" date -d @$(find /var/lib/apt/lists/ -type f -not -name lock -printf '%T@\n' | sort -n | tail -1 | cut -d. -f1)
Thu Sep 15 12:50:54 UTC 2016

You can modify it to verify whether specified package index files are up to date.


Viewing all articles
Browse latest Browse all 770

Trending Articles