Skip to content

Instantly share code, notes, and snippets.

@amir-saniyan
Last active April 25, 2020 14:02
Show Gist options
  • Save amir-saniyan/cdad6b4e9cbef2c3fd5bcdc9e152852c to your computer and use it in GitHub Desktop.
Save amir-saniyan/cdad6b4e9cbef2c3fd5bcdc9e152852c to your computer and use it in GitHub Desktop.
Full Update Script for Ubuntu (apt packages and python libraries)

Full Update Script for Ubuntu

This script updates Ubuntu packages and python libraries.

full-update.sh:

#!/bin/bash

if [ "$EUID" -ne 0 ]
  then echo "Error: Please run as root."
  exit
fi

clear

echo "################################################################################"
echo "Updating list of available packages..."
echo "--------------------------------------------------------------------------------"
apt update
echo "################################################################################"
echo

echo "################################################################################"
echo "Upgrading the system by removing/installing/upgrading packages..."
echo "--------------------------------------------------------------------------------"
apt full-upgrade --yes
echo "################################################################################"
echo

echo "################################################################################"
echo "Removing automatically all unused packages..."
echo "--------------------------------------------------------------------------------"
apt autoremove --yes
echo "################################################################################"
echo

echo "################################################################################"
echo "Clearing out the local repository of retrieved package files..."
echo "--------------------------------------------------------------------------------"
apt autoclean --yes
echo "################################################################################"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment