A recent update to Ubuntu has added messages about the Ubuntu Pro subscription service in both the default message of the day (MOTD) (like when logging into a Ubuntu server) and when using
The message showing up in the MOTD is:
Introducing Expanded Security Maintenance for Applications. Receive updates to over 25,000 software packages with your Ubuntu Pro subscription. Free for personal use.
The message that shows up in
apt commands is similar to this:
Try Ubuntu Pro beta with a free personal subscription on up to 5 machines.
Learn more at https://ubuntu.com/pro
You can read more about Ubuntu Pro on Ubuntu's website if you're curious.
I'm running Ubuntu Server 20.04.5 on my home server, which from my quick research, it looks like the messages only show up in LTS distributions. I really don't care about subscribing to Ubuntu Pro, even if it's free for personal use. I really dislike seeing ads in my OS, so I figured I can just hide the messages.
To hide the message, it's as simple as renaming the file at
/etc/update-motd.d/88-esm-announce. You can do this with the following command:
sudo mv /etc/update-motd.d/88-esm-announce /etc/update-motd.d/88-esm-announce.bak
Simple as that.
Similar to the steps above, you can turn off the messages by renaming the file at
/etc/apt/apt.conf.d/20apt-esm-hook.conf and creating an empty file in its place. The commands are:
sudo mv /etc/apt/apt.conf.d/20apt-esm-hook.conf /etc/apt/apt.conf.d/20apt-esm-hook.conf.bak sudo touch /etc/apt/apt.conf.d/20apt-esm-hook.conf
A reboot should make sure it sticks.
Note that running
apt commands shows the messages, whereas using
apt-get does not. This is because the former is for more human-readable package management, and the latter is used more often in scripts (so you may not see them anyways).
ubuntu-advantage-tools package is the culprit behind these update messages. Some have reported that removing that package will prevent future messages from appearing, but it is a required system package and may break things.
If a future package update changes how this works, I'll try and remember to update this post.