keep ubuntu updated office pc

Revision as of 09:22, 26 September 2014 by Ann (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Since desktop user have no sudo, update via GUI won't work as normal.

What we can do is, set a cronjob for user "root", that will run "apt-get update && apt-get upgrade"

First become user root

sudo -s

Now you are user root, verify with "whoami" or "id" commands.

Create a folder

mkdir /usr/hostonnet

Now create file

vi /usr/hostonnet/

Add following content


/usr/bin/apt-get update && /usr/bin/apt-get -y upgrade

Make it executable

chmod 755 /usr/hostonnet/

Set cronjob, lets run it everyday at 1 PM (lunch break ?)

00 13 * * * /usr/hostonnet/ >/dev/null 2>&1

Now everyday at 13:00 hours, PC will update itself. Make sure you are setting cron a user "root".

cat /var/spool/cron/crontabs/root