Last active
April 30, 2018 03:17
-
-
Save hannesbe/b10334d6c58bc2aa428086505e23a3fc to your computer and use it in GitHub Desktop.
Update script for RPi (packages + firmware)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Upgrade script for RPi (packages + firmware) | |
# | |
# Just run this onliner to launch updates, cleanup & prompt to reboot if required | |
# bash <(curl -sSL https://connexeon.link/upgrade-rpi) | |
function needs_reboot { | |
if [ -f /var/run/reboot-required ]; then | |
read -p "Restart needed. Reboot? (y/N) " answer; | |
if [ "$answer" = "y" -o "$answer" = "Y" ]; then | |
sudo reboot -i; | |
fi | |
else | |
echo "No restart"; | |
fi | |
} | |
sudo apt-get update -y | |
sudo apt-get dist-upgrade -y | |
sudo apt-get upgrade -y | |
sudo apt-get clean | |
sudo apt-get autoremove -y | |
# Update firmware | |
# sudo rpi-update | |
# no longer required > https://raspberrypi.stackexchange.com/questions/4355/do-i-still-need-rpi-update-if-i-am-using-the-latest-version-of-raspbian | |
# Prompt to reboot if required | |
needs_reboot | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment