Last active
August 29, 2015 14:15
-
-
Save HeroCC/31edd41de537240441a8 to your computer and use it in GitHub Desktop.
refresh-available-updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
You can also do this to update after running apt-get:
http://askubuntu.com/a/314414
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
Don't forget to add this to crontab!