Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions #3

Open
dampfklon opened this issue May 1, 2023 · 5 comments
Open

Suggestions #3

dampfklon opened this issue May 1, 2023 · 5 comments

Comments

@dampfklon
Copy link

Thank for maintaining this helpful overview.

After implementing the changes i found two possible improvements

  1. 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.
  2. In /usr/lib/update-notifier/apt_check.py instead of changing the two functions you can change the Line ESM_INFRA_ORIGIN = "UbuntuESM" to some other value like ESM_INFRA_ORIGIN = "UbuntuESM_disabled" which disables the messages without changing actual code. 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
@Skyedra
Copy link
Owner

Skyedra commented May 2, 2023

Thanks for the suggestions, will look into these when I have a bit :)

@Xon
Copy link

Xon commented May 4, 2023

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.

@Skyedra
Copy link
Owner

Skyedra commented May 4, 2023

Great idea, thanks!

@dampfklon
Copy link
Author

Thats exactly what happens when you set ESM_INFRA_ORIGIN = "UbuntuESM_disabled" as the check returns None

@banagale
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants