LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


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

Rep: Reputation: 15
Automatic Updates?


Hi.

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
b0uncer
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):

Code:
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
Code:
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:56 PM.

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