Mac OS X
#!/bin/bash
echo "updateall v.1.1 for OS X. This software will upgrade all your Apple/Homebrew software."
# Run this as a normal user. Your admin password will be asked for if required.
# Update all Apple software (requires admin password at this point)
sudo softwareupdate -i -a
# Update all software installed via Homebrew (as a normal user)
brew update
# Update all other software
mas upgrade
echo "The script has now finished running."
Ubuntu
#!/bin/bash
echo "updateall v.1.2 for Ubuntu"
#Run this as a normal user. Your admin password will be asked for if required.
sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y
sudo apt-get clean -y
sudo apt-get autoclean -y
sudo apt-get autoremove -y
# comment the following out in systems older than 16.04
sudo purge-old-kernels -y
echo "The script has now finished running."
Debian
#!/bin/bash
echo "updateall v.1.0 for Debian."
#Run this as root.
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get clean -y
apt-get autoclean -y
apt-get autoremove -y
echo "The script has now finished running."
Raspian
#!/bin/bash
echo "updateall v.1.2 for Raspian"
#Run this as a normal user. Your admin password will be asked for if required.
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get clean -y
sudo apt-get autoclean -y
sudo apt-get autoremove -y
sudo rpi-update
echo "The script has now finished running."