diff --git a/src/main b/src/main index 76091e4..3352a78 100755 --- a/src/main +++ b/src/main @@ -66,7 +66,12 @@ REQUIRED_PACKAGES=( \ echo "# updating repositories" echo "===================" -sudo apt update +if [[ $(date --date='-12 hours' +%s) -gt $(date -d "$(stat -c %y /var/lib/apt/lists/partial)" +%s) ]]; then + sudo apt update + sudo apt autoremove -y +else + echo "repositories recently updated!" +fi echo "# required packages"