Skip to content

Instantly share code, notes, and snippets.

@jverweijL
Created May 3, 2018 06:53
Show Gist options
  • Select an option

  • Save jverweijL/6aa2383973daec9952e0012a5c1f440d to your computer and use it in GitHub Desktop.

Select an option

Save jverweijL/6aa2383973daec9952e0012a5c1f440d to your computer and use it in GitHub Desktop.
#!/bin/bash
read -e -p "Do you wish to run autoremove? " -i "yes" answer
if [ "$answer" = "yes" ]; then
sudo apt-get autoremove; # Remove deprecated packages
fi
read -e -p "Fetch the list of updates available? " -i "yes" answer
if [ "$answer" = "yes" ]; then
sudo apt-get update; # Fetches the list of available updates
fi
read -e -p "Do you wish to upgrade the current packages? " -i "yes" answer
if [ "$answer" = "yes" ]; then
sudo apt-get upgrade; # Strictly upgrades the current packages
fi
read -e -p "Do you wish to install updates? " -i "yes" answer
if [ "$answer" = "yes" ]; then
sudo apt-get dist-upgrade; # Installs updates (new ones)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment