add option fix for apt

Signed-off-by: Daniel Hansson <mailto@danielhansson.nu>
This commit is contained in:
Daniel Hansson 2023-06-22 12:49:03 +02:00 committed by GitHub
parent e0f7e27797
commit 909949a67f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
lib.sh
View File

@ -1099,6 +1099,12 @@ fi
install_if_not() {
if ! dpkg-query -W -f='${Status}' "${1}" | grep -q "ok installed"
then
# https://askubuntu.com/questions/1235914/hash-sum-mismatch-error-due-to-identical-sha1-and-md5-but-different-sha256#1242739
#if ! -f /etc/gcrypt/hwf.deny ]
#then
# mkdir -p /etc/gcrypt
# echo all > /etc/gcrypt/hwf.deny
#fi
apt-get update -q4 & spinner_loading && RUNLEVEL=1 apt-get install "${1}" -y
fi
}