Skip to content

Instantly share code, notes, and snippets.

@Razuuu
Last active November 7, 2023 15:06
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 Razuuu/f646c3be44c5ba3b9c8e38b0a856d7b4 to your computer and use it in GitHub Desktop.
Save Razuuu/f646c3be44c5ba3b9c8e38b0a856d7b4 to your computer and use it in GitHub Desktop.
Add php repository from sury.org
#!/bin/bash
# Debian Repository not available for trixie (yet)
DISTRO=$(dpkg --status tzdata|grep Provides|cut -f2 -d'-')
if [ "${DISTRO}" == "trixie" ]; then DISTRO="bookworm"; fi
# Install dependencies
apt update
apt install apt-transport-https ca-certificates curl -y
# Download gpg key
curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
# Add Debian Repository
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ ${DISTRO} main" > /etc/apt/sources.list.d/deb.sury.org.list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment