Score:3

Ubuntu server: The list of available updates is more than a week old

cn flag

When I log into my Ubuntu server via SSH, a "Welcome" text is displayed. This text used to contain information about packages avilable for update.

Since some time, always the text "The list of available updates is more than a week old." is displayed instead.

Of course, I regularly check for updates with "sudo apt update". This has no effect on the text on the "Welcome" screen.

Does anybody what's wrong there and how to fix it?

David avatar
cn flag
It would be nice if you had said the version of Ubuntu.
uz flag
Jos
Do you also apply the updates, as in `sudo apt upgrade`? `sudo apt update` merely finds out what updates are available.
Artur Meinild avatar
vn flag
And since it's a server, I would recommend configuring [unattended upgrades](https://help.ubuntu.com/community/AutomaticSecurityUpdates), to apply at least security upgrades automatically.
Bruni avatar
cn flag
@Jos But should `sudo apt update` not update the list of available updates...without the need to actually upgrade?
uz flag
Jos
I believe this is a bug that should have been fixed in Ubuntu 19.10 https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1842159
uz flag
Jos
@Bruni yes, if the OP did `sudo apt update` within the week, the message shouldn't come up.
Thomas1970 avatar
cn flag
Hi! Thanks for your replies!
Thomas1970 avatar
cn flag
Hi! Thanks for your replies! Yes, I regularly run ```sudo apt update``` and ```sudo apt upgrade```. Unattended upgrades are configured for security fixes. However, it's just about the text in the "Welcome" message on the SSH prompt.
Thomas1970 avatar
cn flag
My Ubuntu version is 20.04.3 LTS.
Thomas1970 avatar
cn flag
@Jos: I have ```update-notifier-common/focal-updates``` version 3.192.30.9. The bug you mention should be fixed, but I still have that issue. BTW, I don't have ```update-notifier/focal-updates``` version 3.192.30.9 because this package needs an xserver...
uz flag
Jos
The message is probably stored in `/etc/motd`, but is never removed for some reason. If that is correct, simply try this: `sudo rm /etc/motd`, and see if the message returns.
Thomas1970 avatar
cn flag
@Joe: There is no file ```/etc/motd``` on my system. There is no service ```motd```, too. Maybe that's the reason for my issue?
Thomas1970 avatar
cn flag
Is anything of the following needed? ```motd-news-config/focal-updates,now 11ubuntu5.4 all [installiert]``` ```show-motd/focal-updates 3.6-0ubuntu6.1 all``` ```update-motd/focal-updates 3.6-0ubuntu6.1 all``` ```xmotd/focal 1.17.3b-10 amd64```
us flag
I also have this issue, in Ubuntu 20.04.03 LTS
Score:3
cn flag

I filed this bug report: https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1943638

I have also described a workaround there.

[Edit] Description of the workaround:

In my case, an uncaught exception in line 150 of the file /usr/lib/update-notifier/apt_check.py was the cause.

I fixed this by adding a try...except block around it.

Original code:

    is_esm_supported = bool(
                DISTRO in ubuntu_distro.supported_esm()

Modified code:

    try:
        is_esm_supported = bool(
                DISTRO in ubuntu_distro.supported_esm()
    )
    except AttributeError:
        is_esm_supported = False
Greenonline avatar
us flag
Please [edit] your answer and include the workaround in your answer.
us flag
and then what should be done after editing this file?
Thomas1970 avatar
cn flag
I did nothing else. The cron job which regularly checks for updates triggers this script. With the next execution (e.g. over night), the list should be updated. if my workaround doesn't solve your problem, you may execute the ``apt_check.py`` on the command line to find out what else is failing (might need Python skills).
Score:1
cn flag

The script source of the message (Ubuntu 20.04?) seems to be from

/etc/update-motd.d/90-updates-available

The actual problem (for me) is that

/var/lib/update-notifier/updates-available

is older than 7-days and should be pretty much empty. I achieved that by

echo | sudo tee /var/lib/update-notifier/updates-available
Thomas1970 avatar
cn flag
Yes, something like this was my initial idea, too, but it wouldn't solve the cause, and you won't know whether thre are updates available. Please see my workaround above.
Score:0
cn flag

I tried Thomas1970 suggestion (good year, by the way) and it made zero difference.

I then looked at the file:

sudo nano /var/lib/update-notifier/updates-available

It had the line "The list of available updates is more than a week old." inside. I tried using "#" to block the display but that didn't do anything except print "#" in front of the line.

Next, I erased the content of the file and rebooted.

"The list of available updates is more than a week old." is now gone. I am awaiting further updates to see if I get notifications at login, as Thomas1970 thinks zeroing the file would prevent future update notifications.

I have remmed out the Thomas1970 fix in /usr/lib/update-notifier/apt_check.py for now to see what happens.

For now, my solution at least fixes the notification issue. I continue to do a sudo apt update whenever I log in to my server.

Thomas1970 avatar
cn flag
Recently, the original issue re-appeared for me. I checked whether my workaround was still in place, but it was gone. Probably replaced with the Ubuntu original version by some call of `apt upgrade`. So, I re-inserted my workaround, and the issue is gone again. Conclusion: As long as the issue is not fixed by Ubuntu, my proposal is only a temporary workaround. Vote for https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1943638
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.