Skip to content

Instantly share code, notes, and snippets.

@enwi
Created August 6, 2017 13:39
Show Gist options
  • Save enwi/ad439b56a31986912d853a13f9d3bd42 to your computer and use it in GitHub Desktop.
Save enwi/ad439b56a31986912d853a13f9d3bd42 to your computer and use it in GitHub Desktop.
Simple shell script that updates your linux. If you only want error messages then uncomment the comments in each line.
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[1;32m'
BLUE='\033[1;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}System update${NC}"
sudo apt-get update #2>&1 >/dev/null
echo -e "${BLUE}System upgrade${NC}"
sudo apt-get upgrade -y #2>&1 >/dev/null
echo -e "${BLUE}Dist upgrade${NC}"
sudo apt-get dist-upgrade -y #2>&1 >/dev/null
echo -e "${BLUE}Cleaning up${NC}"
sudo apt-get autoremove -y #2>&1 >/dev/null
sudo apt-get clean #2>&1 >/dev/null
sudo apt-get autoclean -y #2>&1 >/dev/null
if [ "$1" = "-reboot" ] ; then
echo -e "${GREEN}Done!${BLUE}Rebooting now!${NC}"
sudo reboot
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment