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.

Revisions

  1. VictorGob created this gist Nov 25, 2019.
    28 changes: 28 additions & 0 deletions update_script.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    #!/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