Re: Detect upgradable packages in shell script ran as a non-root user

2016-12-02 Thread Jonathan Dowland
One of the problems you will have with many (any?) of the solutions proposed is they rely on the current state of your local apt package metadata cache. Which is to say, if that is not up-to-date, then you are only going to get stale information; and you need to be root to update it. I would

RE: Detect upgradable packages in shell script ran as a non-root user

2016-12-02 Thread Bonno Bloksma
Hi, What I have been using for years is a little script to send me (and the servicedesk) a daily mail: #!/bin/bash # MAILREC is space separated MAILREC="myem...@tio.nl helpd...@tio.nl" SUBJECT="Upgrade report voor $HOSTNAME" TMPFILE=/tmp/upgradereport.tmp # Step 1: update repositories...

Re: Detect upgradable packages in shell script ran as a non-root user

2016-12-01 Thread Tixy
On Wed, 2016-11-30 at 17:09 +0200, Martin T wrote: > I would like to run a cron job which periodically checks if I have > upgradable packages. One way to do it is probably like this: What do you want to do with the information once you got it? I ask because Debian includes some packages to do

Re: Detect upgradable packages in shell script ran as a non-root user

2016-11-30 Thread kushal
Martin T writes: > Hi, > > I would like to run a cron job which periodically checks if I have > upgradable packages. One way to do it is probably like this: > > $ apt-get upgrade -s | grep -q "^0 upgraded" > > In case exit code is >0, then there are upgradable packages. The >

Re: Detect upgradable packages in shell script ran as a non-root user

2016-11-30 Thread Joe
On Wed, 30 Nov 2016 17:09:20 +0200 Martin T wrote: > > For me the "apt-get upgrade -s | grep -q "^0 upgraded"" seems to be > the most reasonable solution, but maybe there is even a better way? > > I've found upgrade-system to be useful, and when installed, it sends a

Re: Detect upgradable packages in shell script ran as a non-root user

2016-11-30 Thread Liam O'Toole
On 2016-11-30, Martin T wrote: > Hi, > > I would like to run a cron job which periodically checks if I have > upgradable packages. One way to do it is probably like this: > > $ apt-get upgrade -s | grep -q "^0 upgraded" > > In case exit code is >0, then there are upgradable

Re: Detect upgradable packages in shell script ran as a non-root user

2016-11-30 Thread Shin Ice
On Wed, Nov 30, 2016 at 10:13:40AM -0500, Greg Wooledge wrote: > On Wed, Nov 30, 2016 at 05:09:20PM +0200, Martin T wrote: > > I would like to run a cron job which periodically checks if I have > > upgradable packages. One way to do it is probably like this: > > > > $ apt-get upgrade -s | grep -q

Re: Detect upgradable packages in shell script ran as a non-root user

2016-11-30 Thread Greg Wooledge
On Wed, Nov 30, 2016 at 05:09:20PM +0200, Martin T wrote: > I would like to run a cron job which periodically checks if I have > upgradable packages. One way to do it is probably like this: > > $ apt-get upgrade -s | grep -q "^0 upgraded" But you have to run apt-get update first, AS root. (Your

Detect upgradable packages in shell script ran as a non-root user

2016-11-30 Thread Martin T
Hi, I would like to run a cron job which periodically checks if I have upgradable packages. One way to do it is probably like this: $ apt-get upgrade -s | grep -q "^0 upgraded" In case exit code is >0, then there are upgradable packages. The second solution I came up with is: $ for package in