First, enable automatic updates like this:
sudo apt-get install unattended-upgrades
You then need to edit its configuration, type
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
(replace nano
with your preferred text editor if you want)
The file looks like this:
Unattended-Upgrade::Allowed-Origins {
"Ubuntu maverick-security";
// "Ubuntu maverick-updates";
};
The //
means this line is a comment and won't be considered by the program, remove the strokes to include stable release updates in addition to security fixes. Also, replace maverick
with the version of Ubuntu you're running.
To set the interval at which the system checks for updates, edit the /etc/apt/apt.conf.d/10periodic
file with a text editor:
APT::Periodic::Update-Package-Lists "14";
APT::Periodic::Download-Upgradeable-Packages "14";
APT::Periodic::AutocleanInterval "14";
APT::Periodic::Unattended-Upgrade "14";
In this example, the system is updated every two weeks.
For a more detailed explanation, see Automatic Updates in the Ubuntu server guide.
Note that papukaija's answer is talking about the interval at which the Update Manager dialogue pops up on your screen, I'm guessing that's not what you wan't, but I'm not sure. :)
There is a package that can be used to do this for you.
sudo apt-get install unattended-upgrades
or if unattended-upgrades already installed. Or you can checkout the Ubuntu docs
sudo dpkg-reconfigure -plow unattended-upgrades
That is the package you need to install. Once its installed edit the files
/etc/apt/apt.conf.d/10periodic
/etc/apt/apt.conf.d/20auto-upgrades
In that file you can set how often you want the server to update.
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
The file should look like that. The 1 means it will update every day. 7 is weekly.
/etc/apt/apt.conf.d/50unattended-upgrades
This files will let you chose what updates you want to make by choosing where apt can search for new updates and upgrades. ( My personal opinion on this is I would set it to security if this is a server )
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
// "${distro_id}:${distro_codename}-updates";
};
The variables ${distro_id}
and ${distro_codename}
are expanded automatically. I would comment out the updates entry and just leave security.
Best Answer
For 10.10 and earlier versions (and 11.04, in an Ubuntu Classic session)
Open Update Manager (System > Administration > Update Manager).
On the Updates tab, there's a drop down box for "Check for updates:", with options for Daily, every two days, weekly or every two weeks.
Or you can turn it off and just check manually whenever you want.