From 7cb2318610522c298d63a5f68d7e730b20f330f2 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 8 May 2023 10:25:33 -0400 Subject: [PATCH] installation --- install_postgres.sh | 12 ++++++++++++ install_python3.sh | 24 ++++++++++++++++++++++++ setup.sh | 11 +++++++++++ 3 files changed, 47 insertions(+) create mode 100755 install_postgres.sh create mode 100755 install_python3.sh diff --git a/install_postgres.sh b/install_postgres.sh new file mode 100755 index 0000000..e998f21 --- /dev/null +++ b/install_postgres.sh @@ -0,0 +1,12 @@ +# Create the file repository configuration: +sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' + +# Import the repository signing key: +wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - + +# Update the package lists: +sudo apt-get update + +# Install the latest version of PostgreSQL. +# If you want a specific version, use 'postgresql-12' or similar instead of 'postgresql': +sudo apt-get -y install postgresql diff --git a/install_python3.sh b/install_python3.sh new file mode 100755 index 0000000..d280195 --- /dev/null +++ b/install_python3.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Update the package list +sudo apt-get update + +# Install the software-properties-common package +sudo apt-get install software-properties-common + +# Add the deadsnakes PPA to the sources list +sudo add-apt-repository ppa:deadsnakes/ppa + +# Update the package list again +sudo apt-get update + +# Check the latest version of Python 3 available +latest_version=$(apt-cache madison python3 | awk '{print $3}' | grep "^3\." | sort -V | tail -1) + +# Install the latest version of Python 3 +sudo apt-get install -y python3=$latest_version + +# Verify the installation +python3 --version +which python3 + diff --git a/setup.sh b/setup.sh index b1aaef9..62d1991 100755 --- a/setup.sh +++ b/setup.sh @@ -184,3 +184,14 @@ while true; do esac done +while true; do + read -p "do you want to install fzf, ripgrep?" yn + case $yn in + [Yy]* ) + sudo apt-get install fzf ripgrep + break;; + [Nn]* ) + break;; + * ) echo "Please answer yes or no.";; + esac +done