Ever wondered how to disable apt news on Ubuntu and get rid of those annoying ads? Here’s everything you need to know about it.
Package updates are vital for any operating system. They can help protect the data. Similarly, the unattended upgrades feature of Ubuntu exists, which installs security patches automatically. This feature is enabled by default in Ubuntu.
However, APT news continuously asking for updates can sometimes be annoying to Ubuntu users. It may be intrusive or unprecedented in Linux, according to some people. This article will discuss how we can disable apt-news in Ubuntu. In addition, we will show you how to disable unattended updates in Ubuntu. We will start with a brief introduction about apt news. Then, the process of disabling apt-news is discussed.
There are both temporary and permanent solutions to disable apt news in Ubuntu. We will also discuss how to disable the unattended upgrades, which can be performed from the command line and through a graphical user interface.
What is APT news?
APT news is an advertisement run by Ubuntu while you run apt commands. Every time you run the apt update or apt upgrade on the Ubuntu Terminal, or sometimes randomly, you may receive these advertisements. A sample advertisement is as follows:
News about significant security updates, features, and services will appear here to raise awareness and perhaps tease /r/Linux 😉
With these advertisements, you may receive invitations to upgrade to Ubuntu Pro. We will now discuss the process of disabling apt news.
How to Disable APT News on Ubuntu Temporarily
There is a temporary solution for disabling apt news. Open your Terminal and type the following command:
$sudo rm /var/lib/ubuntu-advantage/messages/*.tmpl
However, upon the restart of the system, the apt news will pop up again. This is not a permanent solution. Try the steps discussed in the next section when you want a permanent solution.
Disabling apt news from Ubuntu Terminal
Generally, apt news is not considered a big deal. However, we can disable it. There are various ways we can disable apt news from Terminal. Follow the steps below to disable apt-news.
Via pro config command
Open your Terminal and type the following command:
$sudo pro config set apt_news=false
Using the pro config, we have set the apt_news to false. In this way, you will not receive any apt news in the future, and the apt will remain quiet.
Via Ubuntu advantage tool
To disable apt news using the Ubuntu advantage tool, type the following command on your Terminal:
$sudo apt remove ubuntu-advantage-tools
Via symbolic link
There is another approach to disabling apt news. We can create a symbolic link for
/dev/null. For this purpose, type the following command on your Terminal:
$sudo ln -s -f /dev/null /etc/apt/apt.conf.d/20apt-esm-hook.conf
Via commenting out lines in 20apt-esm-hook.conf
Another option for disabling apt news is via commenting out action lines in
20apt-esm-hook.conf file. Type the following command on your Terminal:
$sudo sed -i'' -e 's/^\(\s\+\)\([^#]\)/\1# \2/' /etc/apt/apt.conf.d/20apt-esm-hook.conf
Via renaming 20apt-esm-hook.conf file to .bak file
Another option is to rename
20apt-esm-hook.conf file to
.bak file and create a zero-length file of the same name. For this purpose, type the following command:
$sudo mv /etc/apt/apt.conf.d/20apt-esm-hook.conf /etc/apt/apt.conf.d/20apt-esm-hook.conf.bak
The above command will rename the file. Now, create another file of the same name with the following command:
$sudo touch /etc/apt/apt.conf.d/20apt-esm-hook.conf
Via removing the Ubuntu advantage tool
You can also remove the Ubuntu advantage tool. Removing this package will ensure that other branding packages are removed that are needed. For this purpose, type the following command on your Terminal:
$apt-get --assume-yes --purge remove ubuntu-advantage-tools
Disabling unattended upgrades in Ubuntu
Besides disabling apt news, you can also disable unattended upgrades. For this purpose, you can try the steps below.
Edit the 20auto-upgrades file
Open the Terminal and run the following command:
$ sudo nano /etc/apt/apt.conf.d/20auto-upgrades
This will open the 20auto-upgrades for editing. Now, edit the following lines in the file:
We will change the directive of Update-Package-Lists from 1 to 0. This will disable the feature of unattended upgrades.
Disable unattended upgrades directly
You can also run the following command to disable unattended upgrades:
$ sudo dpkg-reconfigure unattended-upgrades
After running the above command, select No and then press the enter button to disable unattended upgrades, as shown in the snapshot below:
Remove the unattended upgrades feature permanently
To remove this feature permanently, you can run the following command:
$ sudo apt remove unattended-upgrades
Once you have performed the steps above, run the following command to update your system manually:
$ sudo apt update
$ sudo apt upgrade
Disable unattended upgrades graphically
You can disable the unattended upgrades graphically. Go to “software and updates” and look for “automatically check for updates. Change the option to Never. This will turn the automatic updates download to Never.
In this article, we have discussed the process of disabling apt news in Ubuntu. APT news can sometimes be very annoying, so users may want to disable it. We discussed various temporary and permanent solutions. In addition, we discussed the process of disabling unattended updates from the command line and via a graphical user interface.
If this guide helped you, please share it.