From 32dfbd009f6980882ec91de428fbeb5e4cb4e1c8 Mon Sep 17 00:00:00 2001 From: Luka Peschke Date: Thu, 19 Dec 2024 11:13:47 +0100 Subject: [PATCH] fix(install_scripts): fix ubuntu 24.04 compat Signed-off-by: Luka Peschke --- CHANGELOG.md | 1 + toucan_connectors/install_scripts/mssql.sh | 7 ++++-- toucan_connectors/install_scripts/oracle.sh | 25 ++++++++++++++++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e15803d9..80f0d476e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Changed - MSSQL and Azure MSQQL connectors now use the ODBC 18 driver +- The Oracle connector install script is now compatible with Ubuntu 24.04 ## [7.4.1] 2024-12-12 diff --git a/toucan_connectors/install_scripts/mssql.sh b/toucan_connectors/install_scripts/mssql.sh index fa817e192..b3794f11c 100755 --- a/toucan_connectors/install_scripts/mssql.sh +++ b/toucan_connectors/install_scripts/mssql.sh @@ -11,9 +11,12 @@ fi apt-get update apt-get install -fyq --no-install-recommends gnupg curl ca-certificates -curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg -source /etc/os-release +curl -fsSL https://packages.microsoft.com/keys/microsoft.asc -o /tmp/microsoft-key.asc +# --batch to disable TTY and --yes to overwrite the file if it exists +gpg --batch --yes --dearmor -o /usr/share/keyrings/microsoft-prod.gpg /tmp/microsoft-key.asc +rm -f /tmp/microsoft-key.asc +source /etc/os-release curl "https://packages.microsoft.com/config/${ID}/${VERSION_ID}/prod.list" \ | tee /etc/apt/sources.list.d/mssql-release.list diff --git a/toucan_connectors/install_scripts/oracle.sh b/toucan_connectors/install_scripts/oracle.sh index ca5f3faba..793668bf2 100755 --- a/toucan_connectors/install_scripts/oracle.sh +++ b/toucan_connectors/install_scripts/oracle.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x set -e if [[ -e ~/oracle-installed ]]; then @@ -7,9 +7,28 @@ if [[ -e ~/oracle-installed ]]; then fi apt-get update -apt-get install -fyq libaio1 curl wget unzip + +source /etc/os-release +LIBAIO="" +if [[ "$ID" == "debian" ]]; then + LIBAIO="libaio1" + apt-get install -fyq --no-install-recommends \ + curl unzip ca-certificates "$LIBAIO" +else + # Ubuntu 24.04 migrated to 64 bits components for most libs, which does not + # work with the oracle library drivers + LIBAOI="libaio1t64" + apt-get install -fyq --no-install-recommends \ + curl unzip ca-certificates libaio1 "$LIBAIO" + # WARNING: not safe: Creating a symbolic link from the 64bits version to the + # 32bits one. A better fix would probably be to switch to + # https://oracle.github.io/python-oracledb/ eventually + ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 \ + /usr/lib/x86_64-linux-gnu/libaio.so.1 +fi + mkdir -p /opt/oracle -wget 'https://public-package.toucantoco.com/connectors_sources/oracle/oracle_client_lib/instantclient-basiclite-linux.x64-12.2.0.1.0.zip' -O '/tmp/oracle_client_lib.zip' +curl -sSL 'https://public-package.toucantoco.com/connectors_sources/oracle/oracle_client_lib/instantclient-basiclite-linux.x64-12.2.0.1.0.zip' -o '/tmp/oracle_client_lib.zip' unzip /tmp/oracle_client_lib.zip -d /opt/oracle sh -c "echo /opt/oracle/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf" ldconfig