SSH welcome message on 17.04 shows notice about 12.04

I just did a do-release-upgrade going from Ubuntu 16.04 to 17.04. However, now when I login via SSH I have the following message

Welcome to Ubuntu 17.04 (GNU/Linux 4.10.0-20-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

Ubuntu 12.04 LTS end-of-life was April 28, 2017 -- Upgrade your Precise systems!
 $ sudo do-release-upgrade -m server

0 packages can be updated.
0 updates are security updates.

My question is, how can I remove the

Ubuntu 12.04 LTS end-of-life was April 28, 2017 -- Upgrade your Precise systems!
 $ sudo do-release-upgrade -m server

it wasn't there prior the release-upgrade

I checked and I am on Zesty

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:    17.04
Codename:   zesty

My question is not, how can I remove this message, this I found. My question is more, is there a reason why this appears after a release-upgrade? Is this message something generic not taking into consideration the current version of Ubuntu? Or maybe my system is not updated properly?


Solution 1:

My question is more, is there a reason why this appears after a release-upgrade?

It is probably a new feature of Ubuntu 17.04 that it tells you that you should update your other 12.04 systems that are EOL today.

Is this message something generic not taking into consideration the current version of ubuntu?

Yes. It is generic.

Or maybe my system is not updated properly?

The system is updated properly. I see the same message.

To clarify what is going on there, digging deeper into the parts that generate this message, we can find that the message is generated by the /etc/update-motd.d/50-motd-news which picks the MOTD from https://motd.ubuntu.com/.

So this is just a generic MOTD from Ubuntu, which should inform you about the important news around the project.

To disable the message, open the mentioned file and comment out the line including the other or just remove that file.

Solution 2:

I'm using Ubuntu 16.04LTS and noticed this as well.

The console startup message files are all running from /etc/update-motd.d/ -- look at each one (you can even run each one individually) to see what they do.

For me, the file 99-esm is the culprit. It's a poorly-written script with Ubuntu 12.04 hardwritten into it.

Solution: I created a /etc/update-motd.d/disabled directory and moved 99-esm into it.

My only question now is if there's supposed to be a better 99-esm in there. Perhaps in the future, a future linux-image package will put it there if needed. I'm not sure, but at least the annoyance is gone.