From 19497a05973774d767c683e149bb5abd37b37a67 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 20 Jul 2020 17:20:16 +0530 Subject: [PATCH] Improve updating lists --- src/scripts/linux.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 5efb5f76..d48d04c6 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -29,6 +29,7 @@ cleanup_lists() { # Function to update php ppa update_lists() { if [ "$lists_updated" = "false" ]; then + cleanup_lists sudo "$debconf_fix" apt-get update >/dev/null 2>&1 fi } @@ -262,7 +263,10 @@ step_log "Setup PHP" sudo mkdir -p /var/run /run/php . /etc/lsb-release if [ "$DISTRIB_RELEASE" = "20.04" ]; then - LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y + if ! apt-cache policy | grep -q ondrej/php; then + cleanup_lists + LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y + fi fi if [ "$existing_version" != "$version" ]; then