Supressing the Ubuntu Pro messages when updating with apt

Whilst performing routine updates, I've noticed the following notifications beginning to appear:

ubuntu22$ sudo apt upgrade
[...]
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
[...]

Whilst this message is informational only it still an annoyance.

I'm well aware that Ubuntu now provides expanded security mainteance (esm) updates for packages in the main/universe repositories throught it's "Ubuntu Pro" service.

Therefore, we have two options to get rid of the "esm-apps" prompt by:

  1. Either enabling Unable Pro security updates, or
  2. Skip the esm-apps updates and disable the service.

The file /etc/apt/apt.conf.d/20apt-esm-hook.conf appears to be responsible for injecting these messages into apt and can apparently be safely removed without doing any harm.

For me option 1 above was not viable, so whilst exploring option 2 I've arrived at the following solution:

  • Disable both the apt-news and esm-cache services:
    ubuntu22$ sudo systemctl disable --now apt-news.service esm-cache.service
    ubuntu22$ sudo systemctl mask apt-news.service esm-cache.service
  • Rename the 20apt-esm-hook.conf apt config file:
    ubuntu22$ sudo mv /etc/apt/apt.conf.d/20apt-esm-hook.conf{,.disabled}