Files
apt-update/apt-update.sh
2025-01-31 09:55:32 +01:00

14 lines
570 B
Bash
Executable File

#!/bin/bash
apt-get -qq update
listUpgrades=$(apt list --upgradable |grep upgradable |cut -d/ -f1)
echo "$listUpgrades"
echo "=============================="
execUpgrades="DEBIAN_FRONTEND=noninteractive apt-get --yes --assume-yes -o DPkg::options::=\"--force-confdef\" -o DPkg::options::=\"--force-confold\" --only-upgrade -qq install "$listUpgrades
eval $execUpgrades
# https://www.bggofurther.com/2018/07/automate-apt-update-and-keep-current-config-files/
DEBIAN_FRONTEND=noninteractive apt-get --yes -qq autoremove
DEBIAN_FRONTEND=noninteractive apt-get -qq clean