I’ve actually run into two separate causes of this problem during my time running Ubuntu Server machines. And while I am discussing Ubuntu Server in this post, I see no reason why this same problem couldn’t affect the desktop version of Ubuntu, or maybe other Ubuntu variants (Kubuntu, Xubuntu, etc.).
The problem: You’ve enabled automatic security update installation, and yet, security updates are not being automatically installed.
First possible solution: This one is easy. Check the file /etc/cron.daily/apt and make sure that it is marked executable. Permissions on this file should look like rwxr-xr-x (755). This file somehow lost its executability when I upgraded from one Ubuntu release to the next, which broke the daily update check and thus no automatic security update installation.
In the more recent occurrence of this problem for me, the daily update check was obviously happening. I would connect to the server via SSH and see something like…
Welcome to the Ubuntu Server!
* Documentation: http://www.ubuntu.com/server/doc5 packages can be updated.
5 updates are security updates.
So, the daily update check was happening, but the automatic update installation was not. What could cause this?
Well, it turns out that the script that does the update installation will only proceed to that point if the check for updates was successful (no errors at all). This leads us to…
Second possible solution: Run a sudo aptitude update or sudo apt-get update and see if there are any errors. If there are, address them, and hopefully that will resolve the problem. In my case, I had a third-party repository that had become inaccessible, so although the main Ubuntu repositories were updating fine, this error still prevented automatic security update installation.
If you want to know how to set up automatic security updates, there are (at least) three possible ways:
- When first installing the system, you will be given the option to enable automatic security updates.
- Follow the directions on this page in the Ubuntu Wiki. I recommend the apt.conf.d method (which is what will be set up for you using either of the other options presented here), but, the cron method may help you get around other similar issues that prevent automatic updates from working.
- You can set it up using the GUI method like you would with a desktop version of Ubuntu. First, install Synaptic (sudo aptitude install synaptic). Then, make sure that you are connected to your server via SSH with X11 forwarding (by adding the -Y parameter to ssh when you connect). Then, run Synaptic on the server as root (just type “sudo synaptic” at the terminal) and the Synaptic window should appear on your desktop. Then, select “Settings -> Repositories” from the menu, click on the “Updates” tab, and configure automatic updates as you see fit.
Update: November 12, 2010
There is a bug in Ubuntu 10.10 that seems to only affect 32-bit installations but prevents automatic security update installation. See here for details. A fix is already available upstream in Debian; hopefully it will be pushed on to Ubuntu users soon.
Tags: Ubuntu, Ubuntu Server
Your solution involving the permissions on /etc/cron.daily/apt did the trick for me. Thanks!
thanks for the info’s!