Skip to content

Instantly share code, notes, and snippets.

@spy86
Created April 6, 2022 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spy86/8c846a1e29320c8fbf7d08129e53ee63 to your computer and use it in GitHub Desktop.
Save spy86/8c846a1e29320c8fbf7d08129e53ee63 to your computer and use it in GitHub Desktop.
Simple bash script for upgrade
#!/bin/bash
TEXT_RESET='\e[0m'
TEXT_YELLOW='\e[0;33m'
TEXT_RED_B='\e[1;31m'
sudo apt-get update
echo -e $TEXT_YELLOW
echo 'APT update finished...'
echo -e $TEXT_RESET
echo -e $TEXT_YELLOW
echo 'See upgradable packages '
echo -e $TEXT_RESET
apt list --upgradable
echo -e $TEXT_YELLOW
read -p "Are you sure to start upgrade? " -n 1 -r
echo -e $TEXT_RESET
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo apt-get upgrade
echo -e $TEXT_YELLOW
echo 'APT upgrade finished...'
echo -e $TEXT_RESET
apt -y autoremove
echo -e $TEXT_YELLOW
echo 'APT autoremove finished...'
echo -e $TEXT_RESET
apt clean
echo -e $TEXT_YELLOW
echo 'APT clean finished...'
echo -e $TEXT_RESET
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment