• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / Ubuntu / Ubuntu Unattended-Upgrades – Install Ubuntu Automatic Updates via Command Line

Ubuntu Unattended-Upgrades – Install Ubuntu Automatic Updates via Command Line

By Sourabh / December 20, 2016 Category: How To, Ubuntu

How to install security updates in Ubuntu. Download and install “unattended-upgrades” security updates in Ubuntu, from command line (Terminal). Use apt-get to install security updates on Ubuntu Linux.

unattended-upgrades

The unattended-upgrades package can be used to automatically install updated packages, and can be configured to update all packages or just install security updates.

Automatic Updates

First, install the package by entering the following in a terminal:

sudo apt install unattended-upgrades

To enable it, do:

sudo dpkg-reconfigure --priority=low unattended-upgrades

Once installed, you can also configure unattended-upgrades. To configure, simply edit /etc/apt/apt.conf.d/50unattended-upgrades and adjust the following as per the need:

Unattended-Upgrade::Allowed-Origins
{
"Ubuntu xenial-security";
// "Ubuntu xenial-updates";
};

You can also blacklist a certain package so that it will not be automatically updated. To blacklist a package, simply add the package to the list:

Unattended-Upgrade::Package-Blacklist
{
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};

Enable Automatic Updates

On Linux Ubuntu Systems, automatic updates can be enables. One can update the package list, downloads, and installs available upgrades every day. The local download archive is cleaned every week. The results of unattended-upgrades will be logged to /var/log/unattended-upgrades. To enable automatic updates, edit /etc/apt/apt.conf.d/10periodic and set the appropriate apt configuration options:


APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";

Using the “unattended-upgrades” Package

The “unattended-upgrades” Package will create /etc/apt/apt.conf.d/20auto-upgrades with the following contents:
APT::Periodic::Update-Package-Lists “1”;
APT::Periodic::Unattended-Upgrade “1”;

Note:

  • When the apt job starts, it will sleep for a random period between 0 and APT::Periodic::RandomSleep seconds. The default value is “1800” so that the script will stall for up to 30 minutes (1800 seconds) so that the mirror servers are not crushed by everyone running their updates all at the same time. Only set this to 0 if you use a local mirror and don’t mind the load spikes. Note that while the apt job is sleeping it will cause the execution of the rest of your cron.daily jobs to be delayed.
  • If you want the script to generate more verbose output set APT::Periodic::Verbose “1”;
  • If you want the script to automatically reboot when needed, you not only need to set Unattended-Upgrade::Automatic-Reboot “true”, but you also need to have the “update-notifier-common” package installed. On minimal installations this is not installed by default and without it the automatic updater will never reboot and will not even tell you that you need to reboot manually if you have email notifications configured!

Easies Method To Install Security Updates & Upgrades

Run the following set of commands to install all the required packages:

sudo apt-get install unattended-upgrades
sudo unattended-upgrades -d
sudo apt-get upgrade

Tags: Automatic Update Ubuntu, Automatic Upgrade Ubuntu, Insatll Automatic Upgrade Ubuntu, Insatll Securtiy Update Ubuntu, Insatll Securtiy Upgrade Ubuntu, Insatll Ubuntu Automatic Update, Insatll Ubuntu Automatic Upgrade, Insatll Ubuntu Securtiy Update, Insatll Ubuntu Securtiy Upgrade, Insatll Ubuntu Unattended Upgrade, Insatll Unattended Upgrade Ubuntu, Install Automatic Update Ubuntu, Install Automatic Update Ubuntu 16.04, Install Automatic Update Ubuntu 16.10, Install Automatic Upgrade Ubuntu 16.04, Install Automatic Upgrade Ubuntu 16.10, Install Securtiy Update Ubuntu 16.04, Install Securtiy Update Ubuntu 16.10, Install Securtiy Upgrade Ubuntu 16.04, Install Securtiy Upgrade Ubuntu 16.10, Install Ubuntu 16.04 Automatic Update, Install Ubuntu 16.04 Automatic Upgrade, Install Ubuntu 16.04 Securtiy Update, Install Ubuntu 16.04 Securtiy Upgrade, Install Ubuntu 16.04 Unattended Upgrade, Install Ubuntu 16.10 Automatic Update, Install Ubuntu 16.10 Automatic Upgrade, Install Ubuntu 16.10 Securtiy Update, Install Ubuntu 16.10 Securtiy Upgrade, Install Ubuntu 16.10 Unattended Upgrade, Install Ubuntu Automatic Updates via Command Line, Install Unattended Upgrade Ubuntu 16.04, Install Unattended Upgrade Ubuntu 16.10, Securtiy Update Ubuntu, Securtiy Upgrade Ubuntu, Ubuntu 14.04 Automatic Updates, Ubuntu 16.04 unattended-upgrades package, Ubuntu Automatic Security Updates, Ubuntu Automatic Update, Ubuntu Automatic Updates Command Line, Ubuntu Automatic Upgrade, Ubuntu Disable Unattended Upgrades, Ubuntu Install Security Updates, Ubuntu List Security Updates, Ubuntu Security Updates Command Line, Ubuntu Security Updates Only, Ubuntu Securtiy Update, Ubuntu Securtiy Upgrade, Ubuntu Server Security Updates, Ubuntu Unattended Upgrade, Ubuntu Unattended-Upgrades, Ubuntu Unattended-Upgrades - Install Ubuntu Automatic Updates via Command Line, Ubuntu unattended-upgrades package, Ubuntu Unattended-Upgrades Schedule, Unattended Upgrade Ubuntu, Unattended-Upgrades Debian, unattended-upgrades package in Ubuntu, unattended-upgrades package in Ubuntu 16.04, Unattended-Upgrades Reboot

Primary Sidebar

Latest Posts

Use Locate Command To Find File In Linux Terminal By Name

How To Change Terminal Color In Ubuntu Command Line

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

Linux Command To Check RAM Size In Ubuntu Terminal In GB

How To Install Proprietary Drivers In Linux Ubuntu Using Terminal

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap