Linux – Find last time update was performed with apt-get

aptaptitudelinuxUbuntu

I need to find the last time that the

apt-get update

command was run on my server. How can I determine this information?

Best Answer

At least in Ubuntu systems there is a file /etc/apt/apt.conf.d/15update-stamp containing:

APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true";};

So see if you have /var/lib/apt/periodic/update-success-stamp and if you have it, you can use

stat -c %y /var/lib/apt/periodic/update-success-stamp

command to get the the time of the last "apt-get update" invocation.

And if your system does not have that apt configuration file, you can always add it.