Posted: . At: 8:21 AM. This was 1 year ago. Post ID: 16899
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

Ubuntu annoyances. Advertisements in the apt output.

Ubuntu is a good distribution, but the advertisements in the apt output are very annoying. I have found the location of the file containing the ads.

/usr/lib/python3/dist-packages/uaclient/messages.py

This is a sample of this file.

SS_SERVICE_ADVERTISE = """\
Ubuntu Pro with '{service}' enabled provides security updates for
{repository} packages until {year} and has {updates} pending security update{plural}."""  # noqa: E501
 
SS_SERVICE_ENABLED = """\
{repository} packages are receiving security updates from
Ubuntu Pro with '{service}' enabled until {year}. You have received {updates} security
update{plural}."""  # noqa: E501
 
SS_SERVICE_COMMAND = "Enable {service} with: pro enable {service}"
SS_LEARN_MORE = """\
Try Ubuntu Pro beta with a free personal subscription on up to 5 machines.
Learn more at {url}
""".format(
    url=BASE_UA_URL
)
 
SS_POLICY_HINT = """\
For example, run:
    apt-cache policy {package}
to learn more about that package."""
 
SS_NO_THIRD_PARTY = "You have no packages installed from a third party."
SS_NO_UNAVAILABLE = (
    "You have no packages installed that are no longer available."
)
SS_NO_PRO_SUPPORT = "Ubuntu Pro is not available for non-LTS releases."
 
SS_SERVICE_HELP = "Run 'pro help {service}' to learn more"
SS_BOLD_PACKAGES = """\
Package names in {bold}bold{end_bold} currently have an available update
with '{{service}}' enabled""".format(
    bold=TxtColor.BOLD, end_bold=TxtColor.ENDC
)
 
TRY_UBUNTU_PRO_BETA = """\
Try Ubuntu Pro beta with a free personal subscription on up to 5 machines.
Learn more at https://ubuntu.com/pro"""

Edit the relevant sections to look like this and it should fix it.

SS_SERVICE_ADVERTISE = """\
Ubuntu Pro with '{service}' enabled provides security updates for
{repository} packages until {year} and has {updates} pending security update{plural}."""  # noqa: E501
 
SS_SERVICE_ENABLED = """\
{repository} packages are receiving security updates from
Ubuntu Pro with '{service}' enabled until {year}. You have received {updates} security
update{plural}."""  # noqa: E501
 
SS_SERVICE_COMMAND = "Enable {service} with: pro enable {service}"
SS_LEARN_MORE = ""
 
SS_POLICY_HINT = """\
For example, run:
    apt-cache policy {package}
to learn more about that package."""
 
SS_NO_THIRD_PARTY = "You have no packages installed from a third party."
SS_NO_UNAVAILABLE = (
    "You have no packages installed that are no longer available."
)
SS_NO_PRO_SUPPORT = "Ubuntu Pro is not available for non-LTS releases."
 
SS_SERVICE_HELP = "Run 'pro help {service}' to learn more"
SS_BOLD_PACKAGES = """\
Package names in {bold}bold{end_bold} currently have an available update
with '{{service}}' enabled""".format(
    bold=TxtColor.BOLD, end_bold=TxtColor.ENDC
)
 
TRY_UBUNTU_PRO_BETA = ""

The SS_LEARN_MORE and TRY_UBUNTU_PRO_BETA variables need to be edited to change this. Or they could just be edited to useful tips instead. Whichever you desire.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.