Skip to content

Instantly share code, notes, and snippets.

@mansouryaacoubi
Last active April 20, 2020 14:48
Show Gist options
  • Save mansouryaacoubi/08a8e6a2465e77352cea6cf924414744 to your computer and use it in GitHub Desktop.
Save mansouryaacoubi/08a8e6a2465e77352cea6cf924414744 to your computer and use it in GitHub Desktop.
Updates and upgrades system and Raspberry Pi and installs specific programs and modules
#!/bin/bash
# @author Mansour Yaacoubi
# @filename update-rpi.sh
# @task Installs new updates and specific programs
################# CHECK WHETHER SCRIPT IS RUNNING AS ROOT #################
# Run script as root (higher privileges)
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
else
clear
echo
echo "Script is running with higher privileges as: $SUDO_USER -> $(whoami)"
echo
fi
echo "-> apt-get update -y"
apt-get update -y
apt-get install python python-pip python3 python3-pip -y
echo "-> apt-get upgrade -y"
apt-get upgrade -y
echo "-> apt-get dist-upgrade -y"
apt-get dist-upgrade -y
echo "-> apt-get clean"
apt-get clean
echo "-> apt-get --purge -y autoremove"
apt-get --purge -y autoremove
echo "-> rpi-update"
rpi-update
echo "-> reboot"
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment