Skip to content

Instantly share code, notes, and snippets.

@HeroCC
Last active August 29, 2015 14:15
Show Gist options
  • Save HeroCC/31edd41de537240441a8 to your computer and use it in GitHub Desktop.
Save HeroCC/31edd41de537240441a8 to your computer and use it in GitHub Desktop.
refresh-available-updates
#!/bin/bash
rm $HOME/.updates
if [[ -d /usr/lib/update-notifier ]]; then
updates=$(/usr/lib/update-notifier/apt-check 2>&1)
update_mode='sec'
elif [[ $(which aptitude) ]]; then
updates=$(aptitude search '~U' | wc -l)
update_mode='total'
fi
echo "$updates" >> $HOME/.updates
echo "$update_mode" >> $HOME/.updates
@HeroCC
Copy link
Author

HeroCC commented Feb 20, 2015

Don't forget to add this to crontab!

@HeroCC
Copy link
Author

HeroCC commented Mar 29, 2015

You can also do this to update after running apt-get:
http://askubuntu.com/a/314414

@HeroCC
Copy link
Author

HeroCC commented Apr 22, 2015

This may be out of date, the file is now in my .dotfiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment