Recently, whenever I run
apt update/upgrade, I get the following message in the terminal:
Try Ubuntu Pro beta with a free personal subscription on up to 5 machines. Learn more at https://ubuntu.com/pro
Does anyone know any way to get rid of this?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
One option is to create a symbolic link for 20apt-esm-hook.conf to /dev/null:
sudo ln -s -f /dev/null /etc/apt/apt.conf.d/20apt-esm-hook.conf
Another option is to just comment out the action lines in that file:
sudo sed -i'' -e 's/^\(\s\+\)\([^#]\)/\1# \2/' /etc/apt/apt.conf.d/20apt-esm-hook.conf
Or a third option is to just rename that file to a .bak file, and create a zero length file of the same name:
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
You can also raise a complaint at: https://ubuntu.com/legal/data-privacy/enquiry
The fact there is no easy way to switch off these messages is probably against data protection regulations in many countries.
For instance in the UK, it is illegal to market to any user of a service without asking for prior consent and giving you an opportunity to say no.
@waxrat has the answer for removing that message. However, the Ubuntu Pro is the new replacement for Ubuntu Advantage that allows up to 5 systems now and you can purchase up to 10 years of security updates. Ubuntu 22.04 LTS now comes with Ubuntu Pro instead of Ubuntu Advantage, and that is why you are probably seeing that message since Canonical seems to be moving away from UA.
terrance@terrance-ubuntu:~$ ua status SERVICE ENTITLED STATUS DESCRIPTION esm-infra yes enabled Expanded Security Maintenance for Infrastructure livepatch yes enabled Canonical Livepatch service Enable services with: pro enable <service> Account: firstname.lastname@example.org Subscription: email@example.com
terrance@terrance-ubuntu:~$ pro status SERVICE ENTITLED STATUS DESCRIPTION esm-infra yes enabled Expanded Security Maintenance for Infrastructure livepatch yes enabled Canonical Livepatch service Enable services with: pro enable <service> Account: firstname.lastname@example.org Subscription: email@example.com
terrance@terrance-ubuntu:~$ pro --help usage: pro <command> [flags] Client to manage Ubuntu Pro services on a machine. - cc-eal: Common Criteria EAL2 Provisioning Packages (https://ubuntu.com/cc-eal) - esm-infra: Expanded Security Maintenance for Infrastructure (https://ubuntu.com/security/esm) - fips-updates: NIST-certified core packages with priority security updates (https://ubuntu.com/security/certifications#fips) - fips: NIST-certified core packages (https://ubuntu.com/security/certifications#fips) - livepatch: Canonical Livepatch service (https://ubuntu.com/security/livepatch) - usg: Security compliance and audit tools (https://ubuntu.com/security/certifications/docs/usg) Flags: -h, --help show this help message and exit --debug show all debug log messages to console --version show version of pro Available Commands: attach attach this machine to an Ubuntu Pro subscription api Calls the Client API endpoints. auto-attach automatically attach on supported platforms collect-logs collect Pro logs and debug information config manage Ubuntu Pro configuration on this machine detach remove this machine from an Ubuntu Pro subscription disable disable a specific Ubuntu Pro service on this machine enable enable a specific Ubuntu Pro service on this machine fix check for and mitigate the impact of a CVE/USN on this system security-status list available security updates for the system help show detailed information about Ubuntu Pro services refresh refresh Ubuntu Pro services status current status of all Ubuntu Pro services version show version of pro Use pro <command> --help for more information about a command.
To get rid of the spam, uninstall the program generating the spam.
The package that generates this spam is
ubuntu-advantage-tools. Unfortunately removing it is tricky since Ubuntu devs have decided to make this a required system package so they can make more money (yes, that is their official justification).
A clever person named vi0oss came up with a workaround: replace the spammy package with an additional package which
dpkg -I fake-ubuntu-advantage-tools.debto check the metadata:
new Debian package, version 2.0. size 744 bytes: control archive=384 bytes. 300 bytes, 8 lines control Package: fake-ubuntu-advantage-tools Version: 0.1 Architecture: all Conflicts: ubuntu-advantage-tools Breaks: ubuntu-advantage-tools Provides: ubuntu-advantage-tools Description: Ban ubuntu-advantage-tools while satisfying ubuntu-minimal dependency Maintainer: Vitaly _Vi Shukela
dpkg -c fake-ubuntu-advantage-tools.debto check it's actually empty:
drwxr-xr-x root/root 0 2022-10-31 11:58 ./
apt install ./fake-ubuntu-advantage-tools.deb
The following packages will be REMOVED: ubuntu-advantage-tools The following NEW packages will be installed: fake-ubuntu-advantage-tools 0 upgraded, 1 newly installed, 1 to remove and 1 not upgraded.