summaryrefslogtreecommitdiff
path: root/stage4b/01-install-packages/01-run.sh
blob: 14c0c78b4096741bf58ba9d35428673e4f6cee34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash -e

set -o pipefail

REMOVE_LIST="/tmp/remove-packages.txt"

cat > "$REMOVE_LIST" <<EOF
svxlink-gpio 
svxlink-server 
svxreflector 
svxlink-calibration-tools
EOF

# Only remove installed packages
INSTALLED=$(dpkg-query -W -f='${Package}\n' | grep -Fx -f "$REMOVE_LIST" || true)

if [ -n "$INSTALLED" ]; then
    apt-get purge -y $INSTALLED
fi

apt-get autoremove -y
apt-get clean

rm -f "$REMOVE_LIST"


# Pull out svxlink suite as it interferes with soundcards
apt-get purge -y svxlink-gpio svxlink-server svxreflector svxlink-calibration-tools
# Clean up orphaned dependencies
apt-get autoremove -y

# Optional: remove residual config files
apt-get autoclean
apt-get clean