Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install multiple apt packages simultaneously #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 38 additions & 30 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,45 @@
# Update Ubuntu and get standard repository programs
sudo apt update && sudo apt full-upgrade -y

function install {
which $1 &> /dev/null

if [ $? -ne 0 ]; then
echo "Installing: ${1}..."
sudo apt install -y $1
else
echo "Already installed: ${1}"
wanted_packages=(
# Basics
awscli
chrome-gnome-shell
curl
exfat-utils
file
git
htop
jq
yq
nmap
openvpn
tree
vim
wget

# Image processing
gimp
jpegoptim
optipng
)

missing_packages=()

for package in "${wanted_packages[@]}"; do
if ! which "$package" &> /dev/null; then
missing_packages+=("$package")
fi
}

# Basics
install awscli
install chrome-gnome-shell
install curl
install exfat-utils
install file
install git
install htop
install jq
install yq
install nmap
install openvpn
install tree
install vim
install wget

# Image processing
install gimp
install jpegoptim
install optipng
done

printf \
"The following packages are going to be installed:\n%s\n" \
"${missing_packages[*]}"

if ! sudo apt install -y "${missing_packages[@]}"; then
printf "Couldn't install some packages. Exiting.\n"
exit 1
fi

# Run all scripts in programs/
for f in programs/*.sh; do bash "$f" -H; done
Expand Down