Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  21] [ 0]  / answers: 1 / hits: 46968  / 1 Year ago, thu, march 9, 2023, 10:36:20

I know that the command to update the repository lists is:


apt-get update

How to check if it has been executed today or in the last 24 hours?


I do not know if I should check some file timestamp. Or issue another apt command. Or use dpkg utility.


Could not find something useful at man pages.


More From » apt

 Answers
7

You can check your command history in terminal :


history | grep 'apt update'

To check it by time :


HISTTIMEFORMAT="%d/%m/%y %T " history | grep '[a]pt update'

(The [a] part of the regular expression only matches the letter a but has the effect to not match itself when grepping in the history.)


Terminal history with timestamp


[#27297] Saturday, March 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
donurp

Total Points: 328
Total Questions: 128
Total Answers: 123

Location: Faroe Islands
Member since Thu, Apr 8, 2021
3 Years ago
;