yum install -y java-11-openjdk

yum install -y yum-utils

# Install PostgreSQL repo
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Install PostgreSQL
yum install -y postgresql14 postgresql14-server postgresql14-contrib

# Initialize PostgreSQL database
/usr/pgsql-14/bin/postgresql-14-setup initdb

# Allow trust connection from localhost
sed -i 's/scram-sha-256/trust/g' /var/lib/pgsql/14/data/pg_hba.conf

# Autostart PostgreSQL
systemctl enable postgresql-14

# Run PostgreSQL
systemctl start postgresql-14

# Install lsFusion repo
yum-config-manager --add-repo https://download.lsfusion.org/yum

# Import lsFusion GPG Key
rpm --import https://download.lsfusion.org/yum/GPG-KEY-lsfusion

# Install lsFusion server and client
yum install -y lsfusion5-server lsfusion5-client

# Autostart lsFusion server and client
systemctl enable lsfusion5-server
systemctl enable lsfusion5-client

# Run lsFusion server and client
systemctl start lsfusion5-server
systemctl start lsfusion5-client