I've been curious if there is a way to make it so that the Update Manager can check for updates say every few hours rather than daily. Now, I know that I can run sudo apt-get update
to check, but it would be nice to have it show it to me more often...I love having the most up to date system that I can.
I use two scripts, one that runs in the background whenever I am logged in, and one that is allowed through sudo without a password to apt-get update and additionally download packages.
You can download the two scripts I wrote here, or copy and paste them into gedit from below: http://ubuntuone.com/0tNctmQnF2peAsUmaqtyo3
These are the two scripts I wrote:
The first should be called 'background-runner':
And the second should be called 'package-downloader':
To set this up, download or copy and paste the files into gedit and save the files with the names noted above. cd to their location in the terminal and run the following commands:
Now we have to allow the package-downloader script through sudo. Open a terminal and type
at the bottom of the file add the following line replacing MYUSER with the username you run as, and then hit ctrl+x and then enter to save.
Now navigate to 'Startup Applications.' Click add. Name it whatever you like, and enter /usr/local/bin/background-runner for the command. Save this and exit out.
Having logged out and logged back in, the scripts will perform an apt-get update every two hours. You might want to disable the automatic check for updates through the Update Manager's Software Sources dialogue, which you can reach by clicking settings in the bottom left corner. This way update-manager will not check for updates when the script is already doing so more frequently.
The scripts linked here will just do apt-get update by default. If you would like them to also download any packages, you simply need to edit the line in background-runner that says:
and have it say
The same can be done for changing the amount of time in between updates and downloads, just change 120m in
to your desired amount of time in minutes (m) hours (h) seconds (s).
FYI: This could potentially be a security risk if the permissions to /usr/local/bin have been changed. Because package-downloader is a script, and allowed through sudo, BE SURE ONLY ROOT CAN WRITE TO IT!
Post your curiosity here http://brainstorm.ubuntu.com/ and see developers could add one more option as "every hour" or "every minute" by default in the update manager.
Create a cronjob each period of time which runs