0

I have configured unattended-upgrades to run automatically on an Ubuntu Server 18.04. This is working as intended.

How can I check the result of the last unattended-upgrades run through a bash script? In particular, I want to detect if downloading update repository lists or downloading or installing any updated package has failed, for whatever reason. I don't need access to error messages, a single boolean flag whether the unattended upgrade succeeded or failed is sufficient. This information will later be used to indicate whether human interaction is required.

Clarification: I do not want to access the current unattended upgrades status, I want to access the result (success/failure) of the last time unattended upgrades ran.

Cybran
  • 339

1 Answers1

4

Apt does not issue a signal, log entry, or timestamp signifying successful upgrade completion without error. The developers assume that successful completion should follow the linux tradition of feedback only upon error.

Instead of using shell scripts to interact with apt, look into using aptdaemon, the tool intended for the purpose.

user535733
  • 68,493