Added compatibility for debian 11

Replaced apt-key add since it is deprected and will be removed later
new methode will download key directly

From the relevant repo's mysql is not yet updated

Script was tested on all suported platforms
This commit is contained in:
2021-08-18 13:48:53 +02:00
parent caaf895a7f
commit 9ddea0cc0d

View File

@@ -6,6 +6,7 @@ if [ -z "$osrel" ] ; then
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then osrel=ubu1804;
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then osrel=ubu2004;
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then osrel=deb10;
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"11"* ]]; then osrel=deb11;
elif [ "$(grep -oP '(?<=^PLATFORM_ID=).+' /etc/os-release | tr -d '"')" = "platform:el8" ]; then osrel=el8;
else echo "This distro is not (yet) supported" && exit;
fi
@@ -14,7 +15,7 @@ fi
init () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
apt install -y --no-install-recommends software-properties-common gnupg
elif [ "$osrel" = "deb10" ]; then
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ]; then
apt install -y --no-install-recommends gnupg2 apt-transport-https lsb-release ca-certificates curl
elif [ "$osrel" = "el8" ]; then
dnf install --setopt=install_weak_deps=False --best gnupg
@@ -25,8 +26,8 @@ init () {
mysql () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ]; then
curl --retry 7 --retry-delay 5 -s http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql | apt-key add -
echo "deb http://mirror.nxdi.nl/apt/mysql/"$dist"/ "$dist_name" mysql-8.0" >/etc/apt/sources.list.d/mysql.list
curl --retry 7 --retry-delay 5 -s http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql | gpg --dearmor > /usr/share/keyrings/mysql-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/mysql-archive-keyring.gpg arch=amd64] http://mirror.nxdi.nl/apt/mysql/"$dist"/ "$dist_name" mysql-8.0" >/etc/apt/sources.list.d/mysql.list
elif [ "$osrel" = "el8" ]; then
rpm --import http://mirror.nxdi.nl/resources/mysql/RPM-GPG-KEY-mysql
@@ -78,18 +79,18 @@ epel () {
apache () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
add-apt-repository --no-update ppa:ondrej/apache2 -y -n
elif [ "$osrel" = "deb10" ]; then
curl -fsSL https://packages.sury.org/apache2/apt.gpg | apt-key add -
echo "deb https://packages.sury.org/apache2/ "$dist_name" main" > /etc/apt/sources.list.d/apache2.list
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ]; then
curl curl --retry 7 --retry-delay 5 https://packages.sury.org/apache2/apt.gpg -o /usr/share/keyrings/apache2-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/apache2-archive-keyring.gpg] https://packages.sury.org/apache2/ "$dist_name" main" > /etc/apt/sources.list.d/apache2.list
else
echo "$repo repository not available for this Distro"
fi
}
nginx () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] ; then
echo "deb [arch=amd64] http://nginx.org/packages/"$dist" "$dist_name" nginx" > /etc/apt/sources.list.d/nginx.list
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] || [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ] ; then
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg arch=amd64] http://nginx.org/packages/"$dist" "$dist_name" nginx" > /etc/apt/sources.list.d/nginx.list
curl --retry 7 --retry-delay 5 -s https://nginx.org/keys/nginx_signing.key | gpg --dearmor > /usr/share/keyrings/nginx-archive-keyring.gpg
elif [ "$osrel" = "el8" ]; then
rpm --import https://nginx.org/keys/nginx_signing.key
@@ -108,9 +109,9 @@ nginx () {
php () {
if [ "$osrel" = "ubu1804" ] || [ "$osrel" = "ubu2004" ] ; then
add-apt-repository --no-update ppa:ondrej/php -y -n
elif [ "$osrel" = "deb10" ]; then
curl -fsSL https://packages.sury.org/php/apt.gpg | apt-key add -
echo "deb https://packages.sury.org/php/ "$dist_name" main" > /etc/apt/sources.list.d/php.list
elif [ "$osrel" = "deb10" ] || [ "$osrel" = "deb11" ]; then
curl --retry 7 --retry-delay 5 https://packages.sury.org/php/apt.gpg -o /usr/share/keyrings/php-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/php-archive-keyring.gpg] https://packages.sury.org/php/ "$dist_name" main" > /etc/apt/sources.list.d/php.list
elif [ "$osrel" = "el8" ]; then
rpm --import https://rpms.remirepo.net/RPM-GPG-KEY-remi2018
@@ -152,7 +153,7 @@ redis () {
jitsi () {
if [ "$osrel" = "deb10" ] || [ "$osrel" = "ubu1804" ]; then
curl --retry 7 --retry-delay 5 -s https://download.jitsi.org/jitsi-key.gpg.key | apt-key add -
echo 'deb [trusted=yes] http://mirror.nxdi.nl/apt/jitsi/ stable/' >> /etc/apt/sources.list.d/jitsi-stable.list
echo 'deb [trusted=yes] https://download.jitsi.org stable/' >> /etc/apt/sources.list.d/jitsi-stable.list
else
echo "$repo repository not available for this Distro"
fi