17

When I ssh into my Ubuntu 18.04 box I get the motd

1 update could not be installed automatically

Which goes on to tell me to check the unattended-upgrades log.

The log shows no problems. How can I clear this bogus message?

Organic Marble
  • 22,803
  • 12
  • 65
  • 118

2 Answers2

28

OK, it wasn't bogus.

Turns out the script

/etc/update-motd.d/92-unattended-upgrades

produces this message at login.

This script references

/usr/share/unattended-upgrades/update-motd-unattended-upgrades

which in turn looks at the contents of

/var/lib/unattended-upgrades/kept-back

In my case this last file was non-blank because unattended-upgrades tried to update vino, which I have pinned to an old version on this Lubuntu box, because the latest version removes the options dialog.

Deleting /var/lib/unattended-upgrades/kept-back made the message go away - but only till the next time unattended-upgrades ran.

But there was nothing in the logs that it told me to reference about it!!

Organic Marble
  • 22,803
  • 12
  • 65
  • 118
  • Fascinating :) +1 – WinEunuuchs2Unix Dec 18 '19 at 13:32
  • Removing the kept-back file solves the issue, but it would be interesting to run "apt dist-upgrade" before doing so. – Gilberto Albino Jan 17 '21 at 18:28
  • 1
    So, it's definitely not bogus, but it is (was) a bug in `unattended-upgrades`, that was fixed sometime between 18.04 and 20.04. Basically, even on a successful run of `unattended-upgrades`, the `kept-back` file would **NOT** be deleted. That behavior is fixed in the latest version. – crimson-egret Feb 22 '21 at 22:20
  • @crimson-egret It wasn't fixed so much in my system (20.04). I too had to remove it manually. I did it after having tried `sudo apt install ` told me that those packages were already the newest version, so I think it was just a bug/bogus message. – Andyc Aug 14 '21 at 13:32
  • The same on my 20.04. Is there an open issue for that somewhere already? Or closed one claiming that it was fixed? – reducing activity Dec 17 '21 at 08:39
1

I'm not sure if this it the right way, but after I saw this discussion, I found there was NO kept-back file in /var/lib/unattended-upgrades/ in my environment. Thus, I tried making the kept-back file.

sudo touch /var/lib/unattended-upgrades/kept-back
sudo reboot

Then,

0 update could not be installed automatically

appeared instead of

20 update could not be installed automatically

(In my case, the number was 20, not 1.) Then, I tried unattended-upgrades and rebooted again as below.

sudo unattended-upgrades
sudo reboot

After this, the 20 update could not be installed automatically message never appears.

Charlie
  • 11
  • 1