Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Ubuntu This forum is for the discussion of Ubuntu Linux.


  Search this Thread
Old 06-23-2006, 12:40 PM   #1
Registered: Apr 2004
Location: Ohio
Distribution: Ubuntu 6.06 LTS (Ubuntu, Edubuntu, Ubuntu Server)
Posts: 77
Blog Entries: 2

Rep: Reputation: 15
Automatic Updates?


I am running a linux webserver at a location that I do not often have access to. This presents a problem for keeping the system updated. Is there a way to have Ubuntu download and install updates automatically, without requiring user intervention?
Old 06-23-2006, 12:49 PM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Sure. There might be multiple ways of achieving this, but one sure way is to use Cron to schedule the apt-get run when you want it to. If you'd like to install every possible update every day at 00.04 (four minutes after midnight), open console, become root and add crontab entry as follows (all the italic texts are comments, so only the "normal" written text is actual code or commands):

crontab -e
# go to the last line, then press A (shift-a) to get into Append mode;
# then press enter and to the new line write the following:
04 0 * * * apt-get update && apt-get -q=2 dist-upgrade
# now save the crontab by pressing ESC (press twice if unsure) and
# then type :wq and press ENTER
Now you should have a crontab that updates apt-get package lists four minutes after midnight every day. Note that the above example contains the switch "-q=2" which means "quiet quiet", so apt WILL update everything available, and possibly remove packages if needed, WITHOUT ASKING YOU. I strongly recommend you to add "-d" to the line above, thus causing it to only download the needed packages, and do the actual installation either by hand when you can; this way you could prevent damage from happening if apt decided to install or remove some packages against your will.

If you wish to specify weekdays or days of month, please read
man crontab
for more information (about the time-defining piece of line that in the above example is "04 0 * * *").

Last edited by b0uncer; 06-23-2006 at 12:57 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Get Automatic Updates To RH 3.0 bpellet314 Linux - Newbie 1 06-29-2005 10:31 AM
automatic updates check ilnli Slackware 4 01-03-2005 01:10 PM
Automatic Updates of packages jonty_11 Programming 3 09-29-2004 05:11 PM
automatic updates sirjosi Linux - Newbie 2 01-13-2004 03:58 PM
Automatic Updates! tolis Red Hat 3 12-14-2003 01:02 AM > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration