Assume I need to write a cron job to automate the installation of security update daily, which command I should use for better reliability?


You don't need a cron job to install security update. unattended-upgrade do it for you, automatically. From its description in pkg on Ubuntu 12.04

 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.

you just need install it, then

dpkg-reconfigure unattended-upgrades 

then, choose "YES" and let it do its jobs.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.