Use mirror for ppa:ondrej/php on Ubuntu 16.04

This commit is contained in:
Shivam Mathur 2021-05-01 16:34:21 +05:30
parent 8bed24ebe1
commit bc906f7414
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -30,13 +30,18 @@ cleanup_lists() {
# Function to add ppa:ondrej/php. # Function to add ppa:ondrej/php.
add_ppa() { add_ppa() {
ppa=${1:-ondrej/php} ppa=${1:-ondrej/php}
if ! apt-cache policy | grep -q "$ppa"; then if [ "$DISTRIB_RELEASE" = "16.04" ] && [ "$ppa" = "ondrej/php" ]; then
LC_ALL=C.UTF-8 sudo apt-add-repository --remove ppa:"$ppa" -y || true
LC_ALL=C.UTF-8 sudo apt-add-repository http://setup-php.com/ondrej/php/ubuntu -y
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 4f4ea0aae5267a6c
elif ! apt-cache policy | grep -q "$ppa"; then
cleanup_lists "$(dirname "$ppa")" cleanup_lists "$(dirname "$ppa")"
LC_ALL=C.UTF-8 sudo apt-add-repository ppa:"$ppa" -y LC_ALL=C.UTF-8 sudo apt-add-repository ppa:"$ppa" -y
fi
if [ "$DISTRIB_RELEASE" = "16.04" ]; then if [ "$DISTRIB_RELEASE" = "16.04" ]; then
sudo "$debconf_fix" apt-get update sudo "$debconf_fix" apt-get update
fi fi
fi
} }
# Function to update the package lists. # Function to update the package lists.