Automatic Daily Package Updates Using Cron And Apt-Get
WARNING: As with any system changes, the potential for creating new or additional problems may occur. Please be sure to backup your data and configurations! Use this document at your own risk.
Creating the Daily Cron Job File
First you will need to create the cron job file. You can use a simple text editor to create the file and save it in your home directory. In the Text Editor, type the following lines:
apt-get upgrade -y
Now click Save and name the file something like "autoupdt".
Moving the Cron Job File to Cron.Daily
Now that you have created the cron job file, it needs to be moved into the daily cron directory so that it will be run automatically on a daily basis. To do this, we first need to open a command line terminal (CTRL+ALT+T).
We need to move the file to the proper directory. Type the following command at the command line prompt to move the file:
sudo mv /where/ever/autoupdt /etc/cron.daily
Making the Cron Job File Executable
Now that the file is created and ready to be run daily by cron, we still need to make the file executable in order for cron to be able to run it.
sudo chmod 755 /etc/cron.daily/autoupdt
For more details on custom configuration of cron, please refer to: