Skip to content

Instantly share code, notes, and snippets.

@VictorGob
Created November 25, 2019 10:32
Show Gist options
  • Save VictorGob/dc156f22c7d0f1a6daaecb2d22f2768d to your computer and use it in GitHub Desktop.
Save VictorGob/dc156f22c7d0f1a6daaecb2d22f2768d to your computer and use it in GitHub Desktop.
Bash script: updating Ubuntu and snaps
#!/bin/bash
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
echo -e ""
echo -e "\e[1;31m****************Update & dist-upgrade!!\e[0m"
echo -e ""
sudo apt update
sudo apt -y dist-upgrade
echo -e ""
sudo do-release-upgrade
echo -e ""
echo -e "\e[1;31m****************Ending update script\e[0m"
echo -e ""
echo -e "\e[1;31m****************Snap refresh\e[0m"
echo -e ""
snap refresh
echo -e ""
echo -e "\e[1;31m****************Cleaning\e[0m"
echo -e ""
sudo apt clean
sudo apt -y autoremove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment