Last active
August 29, 2015 14:19
-
-
Save danog/0212e89f81297e371346 to your computer and use it in GitHub Desktop.
Update Debian/Ubuntu system
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 | |
# Debian/Ubuntu updater script | |
# Created by Daniil Gentili | |
if [ "$1" = "--help" ]; then | |
echo "Debian/Ubuntu upgrade script created by Daniil Gentili. | |
Usage: just type | |
update.sh | |
:) | |
All arguments are passed on to apt-get. | |
" | |
exit | |
fi | |
if [ $(id -u) -ne 0 ]; then | |
sudo $0 $* | |
exit $? | |
fi | |
echo "Updating package list..." && | |
apt-get $* update && | |
echo "Upgrading this system and all its packages..." && | |
apt-get $* -y dist-upgrade && | |
printf "Removing unnecessary packages..." && | |
apt-get $* -y autoremove && | |
echo "Cleaning up..." && | |
apt-get clean && | |
echo 'All done! | |
Bye!' | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment