Open dampfklon opened 1 year ago
Thanks for the suggestions, will look into these when I have a bit :)
That isn't actually enough to stop /usr/lib/update-notifier/apt-check --human-readable
from outputting a bunch of spammy text;
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status
There are actually two lines to be changes, from:
have_esm_infra = has_esm_service(cache, esm_origin=ESM_INFRA_ORIGIN)
have_esm_apps = has_esm_service(cache, esm_origin=ESM_APPS_ORIGIN)
to
have_esm_infra = None
have_esm_apps = None
Which is much simpler than patching the functions and fully supressed the ESM related messages.
Great idea, thanks!
Thats exactly what happens when you set ESM_INFRA_ORIGIN = "UbuntuESM_disabled"
as the check returns None
The command would be like
sudo sed -Ezi.orig 's/ESM_INFRA_ORIGIN = "UbuntuESM"/ESM_INFRA_ORIGIN = >"UbuntuESM_disabled"/' /usr/lib/update-notifier/apt_check.py
I don't know if this was intended to fully replace the readme's current:
sudo sed -Ezi.orig \
-e 's/(def _output_esm_service_status.outstream, have_esm_service, service_type.:\n)/\1 return\n/' \
-e 's/(def _output_esm_package_alert.*?\n.*?\n.:\n)/\1 return\n/' \
/usr/lib/update-notifier/apt_check.py
But I tried the former on Ubuntu 18.04.06
followed by the regen line and it did not remove the message mentioned by @Xon
I then tried the latter (current readme method) followed by the regen line and that did work.
Thank for maintaining this helpful overview.
After implementing the changes i found two possible improvements
apt-get purge ubuntu-advantage-tools
after installing the fake package. This automatically removes the hole/var/lib/ubuntu-advantage
directory seems the cleaner way than removing only the cached messages./usr/lib/update-notifier/apt_check.py
instead of changing the two functions you can change the LineESM_INFRA_ORIGIN = "UbuntuESM"
to some other value likeESM_INFRA_ORIGIN = "UbuntuESM_disabled"
which disables the messages without changing actual code. The command would be likesudo sed -Ezi.orig 's/ESM_INFRA_ORIGIN = "UbuntuESM"/ESM_INFRA_ORIGIN = "UbuntuESM_disabled"/' /usr/lib/update-notifier/apt_check.py