How to find out in a shellscript if upgrades are available after an apt-get update
772
I have a script that executes apt-get update on several servers and I have to find out whether there are upgrades available or not in order to schedule apt-get upgrades etc...
Looking at the docs I don't see how I could do this task.
You can use
apt-get -s dist-upgrade
and parse it's output.-s
means simulation: no real actions will be doneOn one of my Ubuntu servers I use a program called
unattended-upgrades
. It sends me an email every night with a list of available updates.