Skip to content

Instantly share code, notes, and snippets.

@micw
Last active January 29, 2018 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micw/376bab5b412c019af050097a0079123d to your computer and use it in GitHub Desktop.
Save micw/376bab5b412c019af050097a0079123d to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
pkgs=(libclamav7 libclamav-dev clamav-base clamav-daemon clamav-dbg clamav-docs clamav-freshclam clamav-milter clamav-testfiles clamav)
installed_pkgs=( $( dpkg-query -f '${binary:Package}\n' -W | grep clamav ) )
update_pkgs=()
for p1 in "${pkgs[@]}"; do
for p2 in "${installed_pkgs[@]}"; do
if [[ $p1 == "$p2" ]]; then
update_pkgs+=( "$p1" )
break
fi
done
done
echo "Please run the following commands:"
echo "apt-get remove --purge clamdscan"
for p in "${update_pkgs[@]}"; do
suffix="amd64"
if [ $p == "clamav-base" -o $p == "clamav-docs" -o $p == "clamav-testfiles" ]; then
suffix="all"
fi
file=${p}_0.99.2+dfsg-0+deb8u4_${suffix}.deb
echo dpkg -i ${file}
done
echo "killall -9 clamd; service clamav-daemon restart"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment