Ubuntu: How do I enable silent updates for my system?


How can I tell Ubuntu 12.10 to perform auto updates silently without any questions and messages? In GUI tool there is an option to do this if security updates are available. But I want all updates to be installed this way.

I think it can be done using apt-get with cron. But is it the best way?


The package unattended-upgrades is used by Ubuntu to silently install important security updates to your system. It is enabled by default and runs on every current Ubuntu release.

You can use the same utility to upgrade your system by enabling unattended-upgrades to upgrade non security related updates. For that use your favourite text editor to edit the necessary config file located on /etc/apt/apt.conf.d/50unattended-upgrades, ie:

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades  

and remove the // marks on the start of the line "${distro_id}:${distro_codename}-updates"; so it looks like this

enter image description here

Dont forget to save the file.

You can change the configuration of the unattended updates by editing the file /etc/apt/apt.conf.d/10periodic, options for the configuration are in the /etc/cron.daily/apt script header. Read them to configure the frequency of the unattended updates.

That is it! Your system will be updating itself, user independent and without interaction needed.


This is not a good idea, but one of the great things about Linux is you can do it anyway.

in a root conjob run

apt-get update && apt-get upgrade -y

This will update the apt-cache and then apply your upgrades. However, this could also fail if there are conflicting config files or other things dpkg needs to prompt for (dpkg will detect that it's non-interactive and will do the default for the question, the same as if you just pressed enter on the command line, if there is no default dpkg will fail).

There is also the problem of human tendency. If you update your system like this, things could change on you randomly. This could cause things to break or act differently until you restart the program. However you would have no way of knowing this, because everything happened behind the scenes.

A slightly better option may be to pop the GUI at a given time. Something like:

0 3 * * * export DISPLAY=:0 && /usr/bin/update-manager

in your users crontab. Again this will fail quite a bit (if that user is not logged in at 3am, if the DISPLAY variable is wrong, etc.)

Basically it's a bad idea, no one needs to be "that" up to date, set the "other updates" to display immediately in update-manager, and accept that your only going to get the notice when something on the system runs apt-get update (there is already a nightly cron job for this.)

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »