Updating a Dog-based OS : bash script
Posted: Sat 14 Dec 2019, 14:16
#!/bin/bash
apt list --upgradable | grep -v 'Listing...' | cut -d/ -f1 | tr '\r\n' ' ' | sed '$s/ $/\n/'
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
sudo snap refresh
sudo flatpak update -y
Last two lines optional, depending on whether or not you use snap or flatpak packages.
Second line address upgradable packages, list them (optional).
Call this script update, make it executable and put it under usr/bin.
To upgrade your OS : $ update
apt list --upgradable | grep -v 'Listing...' | cut -d/ -f1 | tr '\r\n' ' ' | sed '$s/ $/\n/'
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y
sudo snap refresh
sudo flatpak update -y
Last two lines optional, depending on whether or not you use snap or flatpak packages.
Second line address upgradable packages, list them (optional).
Call this script update, make it executable and put it under usr/bin.
To upgrade your OS : $ update