PDA

View Full Version : Update hoary automaticly daily?


HiddenWolf
November 17th, 2004, 02:57 PM
I've tried setting up cron previously, but to my best knowledge, that didn't work out.

Can you guys give me the steps I need to take in order to make sure that my system runs a apt-get update && apt-get upgrade daily?

*it is so annoying to have to download a few hunderd mb because you wheren't home for a few days.*

jdong
November 17th, 2004, 04:20 PM
You can use a cronjob, but it has to be scripted. Make a script /etc/cron.daily/01apt-upgrade:


#!/bin/bash
apt-get update
apt-get -y dist-upgrade

HiddenWolf
November 17th, 2004, 04:54 PM
/me hopes it will work. :-)

Magneto
November 19th, 2004, 09:00 AM
You can use a cronjob, but it has to be scripted.

? i dont have a script and it worked fine for me in cron

here's my crontab

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.
#edited
# Global variables
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# minute (0-59),
# | hour (0-23),
# | | day of the month (1-31),
# | | | month of the year (1-12),
# | | | | day of the week (0-6 with 0=Sunday).
# | | | | | user commands

#-----------{default crap}-------# check scripts in cron.hourly, cron.daily, cro
n.weekly and cron.monthly
17 * * * * root run-parts --report /etc/cron.hou
rly
25 6 * * * root test -e /usr/sbin/anacron || run
-parts --report /etc/cron.daily
47 6 * * 7 root test -e /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6 1 * * root test -e /usr/sbin/anacron || run-parts --report /etc/cron.monthly

#-----------{daily jobs}---------#
35 18 * * * root apt-get update && apt-get -y upgrade

jdong
November 19th, 2004, 05:13 PM
That's what I had before, but I found that at times it wouldn't upgrade, or leave things not fully upgraded.

ubuntu_demon
November 19th, 2004, 06:48 PM
I want to do my dist-upgrades myself and see what's happening. Als I do not want to do automatic upgrades if there's a possible problem.

I have the following lines in my script :

#! /bin/sh
apt-get update
apt-get upgrade -y -t warty-security
apt-get upgrade -y -t hoary-security
apt-get upgrade --trivial-only
apt-get autoclean

-----

jdong
November 19th, 2004, 07:24 PM
dist-upgrades should be watched warily in Hoary...

Also, redirect the output to a logfile. (i.e. apt-get dist-upgrade >> /var/log/apt-upgrade.log).

that's really helpful just in case something goes wrong!

ubuntu_demon
November 19th, 2004, 07:35 PM
just install debfoster that keeps in track all the new things you've installed. And if you've got a problem maybe you have removed some useful package .. try :

apt-get install ubuntu-base ubuntu-desktop

jdong
November 19th, 2004, 08:56 PM
shoot wrong button... Hoary mods, unset resolved state...


Anyway, what I meant were the 'dpkg: trying to overwrite /a/b/c' messages, or the worst 'dpkg: package foo is in a very inconsistent state' messages -- which are possibilities in a development tree. Having a log of these is great for debugging.

jts
December 16th, 2004, 11:32 PM
This is one feature I'd like to see improved in Ubuntu. Some sort of update checker, a la Windows Update (I know..gasp) or Suse that has an icon letting you know that updates are ready to be installed. Then some UI that allows a user to configure security updates automatically at a scheduled time, upgrade the distibution, and/or just update the new security updates.

Cron is not that scary, but to a new user it might be.