Debloating Ubuntu
Disable ESM Ad in MOTD
This will remove the additional security update can be applied with ESM Apps ad.
Disable ESM Ad
sudo touch /var/lib/update-notifier/hide-esm-in-motd #(1)!
sudo /usr/lib/update-notifier/update-motd-updates-available --force #(2)!
sudo run-parts /etc/update-motd.d/ # Optional: (3)
-
This will clear the ESM updates available cache. Without running this command, Ubuntu will give the cached MOTD with the ESM ad for a few hours.
-
This will display what your new MOTD will look like.
Before & After
Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.8.0-78-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Mon Jan 01 00:00:00 PM UTC 2025
System load: 0.0 Processes: 0
Usage of /: 0% of 32.00GB Users logged in: 1
Memory usage: 0% IPv4 address for eth0: 192.168.1.1
Swap usage: 0%
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
1 additional security update can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm
Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.8.0-78-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Mon Jan 01 00:00:00 PM UTC 2025
System load: 0.0 Processes: 0
Usage of /: 0% of 32.00GB Users logged in: 1
Memory usage: 0% IPv4 address for eth0: 192.168.1.1
Swap usage: 0%
0 updates can be applied immediately.
Disable Motd Ad
This may have a real use, but I've only ever seen it used to advertise for Canonical's services.
Before & After
Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.8.0-78-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Mon Jan 01 00:00:00 PM UTC 2025
System load: 0.0 Processes: 0
Usage of /: 0% of 32.00GB Users logged in: 1
Memory usage: 0% IPv4 address for eth0: 192.168.1.1
Swap usage: 0%
* Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
just raised the bar for easy, resilient and secure K8s cluster deployment.
https://ubuntu.com/engage/secure-kubernetes-at-the-edge
Welcome to Ubuntu 24.04.3 LTS (GNU/Linux 6.8.0-78-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Mon Jan 01 00:00:00 PM UTC 2025
System load: 0.0 Processes: 0
Usage of /: 0% of 32.00GB Users logged in: 1
Memory usage: 0% IPv4 address for eth0: 192.168.1.1
Swap usage: 0%
Disable Other Parts of MOTD
Ubuntu stores the following MOTD configuration modules in /etc/update-motd.d/. You can disable any of them with sudo chmod -x /etc/update-motd.d/$MOTD_TO_DISABLE