Update Manager is constantly offering me updates (e.g. security fixes, updates from PPAs).
How can I tell my Ubuntu installation to automatically download and install updates whenever they become available?
Update Manager is constantly offering me updates (e.g. security fixes, updates from PPAs).
How can I tell my Ubuntu installation to automatically download and install updates whenever they become available?
Although it is not wrong or dangerous (see comments to this answer), using apt-get upgrade -y
is not the best way to achieve this.
unattended-upgrades is one of the best practices of having automatic updates, especially for headless machines or servers!
You can set up unattended-upgrades pretty easily by typing this in a terminal:
sudo apt-get install unattended-upgrades
sudo dpkg-reconfigure unattended-upgrades
From the description:
This package can download and install security upgrades automatically
and unattended, taking care to only install packages from the
configured APT source, and checking for dpkg prompts about
configuration file changes.
unattended-upgrades
is preferable but apt-get -y upgrade
is not wrong or dangerous at all. sudo apt-get upgrade
will never (with or with out y
, with or without explicit user approval) install any new package or uninstall any installed package. (From man apt-get
: "under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed.") Remember, the -y
flag can be used with other, potentially more dangerous commands than upgrade
, such as dist-upgrade
.
– Eliah Kagan
Jun 19 '12 at 04:12
APT::Periodic::Download-Upgradeable-Packages "0";
to 1 and should also set APT::Periodic::AutocleanInterval "0";
to something in days in /etc/apt/apt.conf.d/10periodic
or not? Also you would not be do this instead of the GUI way if you would only security updates so you also have to uncomment // "${distro_id}:${distro_codename}-updates";
in /etc/apt/apt.conf.d/50unattended-upgrades
to really have automatic upgrades for all code packages. This can then be extended to update even more.
– redanimalwar
May 02 '14 at 03:07
In the Update Manager click the Settings
button. This dialog will show up:
Select the "Download and install automatically". This will automatically install security updates. If you want to set this up for them remotely via, you can do this:
sudo apt-get install unattended-upgrades
If the package is installed already you can do:
sudo dpkg-reconfigure unattended-upgrades
to change it's behavior. Follow the prompts to enable the feature once you run the command. There's currently no graphical method to just set the entire system to update unattended for everything (you want to play it safe when it comes to automatic upgrades), but setting security updates automatically is a good idea.
Check out the pages for more information if you want to automate getting -updates and -backports:
update-manager
– Att Righ
Oct 17 '22 at 10:36
You can do this easily for security updates.
From System Settings open Update Manager. Click the 'Settings...' button, then on the 'Updates' tab, select the radio button 'Install security updates without confirmation.'
To automatically install all updates, see the answer below.
Go to terminal, and enter:
sudo dpkg-reconfigure unattended-upgrades
Say "yes" to the prompt. You'll still be notified about "normal" updates, such as those that contain bugfixes, but security updates will be installed automatically.