Skip to content

Instantly share code, notes, and snippets.

@tonywang0122
Created February 14, 2022 12:48
Show Gist options
  • Save tonywang0122/42f8e4d536ceeea3834f89b77f84bf52 to your computer and use it in GitHub Desktop.
Save tonywang0122/42f8e4d536ceeea3834f89b77f84bf52 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Install Dev & Tool package
#
# Eclipse Adoptium GPG key
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo apt-key add -
# Configure the Eclipse Adoptium apt repository
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
apt update
apt install curl git libaio1 zip unzip wget apt-transport-https gnupg temurin-8-jdk maven -y
apt clean
# Add JAVA_HOME to the end of .bashrc
JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
echo -e '\nexport JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")\n' >> ~/.bashrc
# Select Default java version
# update-alternatives --set java
# update-alternatives --set javac
#
# Install Oracle Instant Client
#
rm -rf /opt/oracle
mkdir -p /opt/oracle
OCI=/tmp/instantclient-basic-linux.x64-19.14.0.0.0dbru.zip
OCI_SDK=/tmp/instantclient-sdk-linux.x64-19.14.0.0.0dbru.zip
if [ ! -f "$OCI" ]; then
wget --output-document=/tmp/instantclient-basic-linux.x64-19.14.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/1914000/instantclient-basic-linux.x64-19.14.0.0.0dbru.zip
fi
if [ ! -f "$OCI_SDK" ]; then
wget --output-document=/tmp/instantclient-sdk-linux.x64-19.14.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/1914000/instantclient-sdk-linux.x64-19.14.0.0.0dbru.zip
fi
unzip $OCI -d /opt/oracle
unzip $OCI_SDK -d /opt/oracle
sh -c "echo /opt/oracle/instantclient_19_14 > /etc/ld.so.conf.d/oracle-instantclient.conf" && ldconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment