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

Significant changes: Install new packages and change format #5

Merged
merged 10 commits into from
Feb 17, 2024
16 changes: 13 additions & 3 deletions install.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
set -eux

export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true

shdir="scripts"

for bashfile in $(cat $shdir/run_order.txt); do
echo -e "\nExecuting $bashfile ...\n"
bash "$shdir/$bashfile"
run_order="$shdir/run_order.txt"
if [[ ! -f "$run_order" ]]; then
echo "error: run_order.txt not found" >&2
exit 1
fi

scripts=( $(cat "$run_order" | grep "\S" | grep -v "^#" ) )
for script in "${scripts[@]}"; do
echo -e "\nExecuting $script ...\n"
bash "$shdir/$script"
done
4 changes: 2 additions & 2 deletions scripts/add_repo.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -eux

echo "Enabling universe repo.."
add-apt-repository universe
add-apt-repository -y universe

echo "Enabling multiverse repo.."
add-apt-repository multiverse
add-apt-repository -y multiverse
3 changes: 3 additions & 0 deletions scripts/add_users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ usermod -aG sudo $ADMIN_USER
echo "Creating team account, $TEAM_USER..."
useradd --create-home --password $(echo $TEAM_PASSWORD) --shell /bin/bash $TEAM_USER

echo "Creating mock account, $MOCK_USER..."
useradd --create-home --password $(echo $MOCK_PASSWORD) --shell /bin/bash $MOCK_USER

chmod -R -v 750 /home/*
33 changes: 33 additions & 0 deletions scripts/eclipse.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -eux

ECLIPSE_VERSION="2023-12"

# download eclipse: https://www.eclipse.org/downloads/packages/
wget -c -O "eclipse.tar.gz" \
"https://mirror.kakao.com/eclipse/technology/epp/downloads/release/${ECLIPSE_VERSION}/R/eclipse-java-${ECLIPSE_VERSION}-R-linux-gtk-x86_64.tar.gz"

# extract and keep the files in /opt
tar -zxvf eclipse.tar.gz
mv "eclipse" /opt

# remove the tarball
rm eclipse.tar.gz

cat >eclipse.desktop <<EOF
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
Name[en_US]=Eclipse
EOF

# copy the desktop entry to appropriate location
mv eclipse.desktop /usr/share/applications/
12 changes: 12 additions & 0 deletions scripts/gcc-12.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -eux

echo "Installing gcc-12, g++-12..."

apt install -y gcc-12 g++-12

update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-12 80 \
--slave /usr/bin/g++ g++ /usr/bin/g++-12 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-12
4 changes: 0 additions & 4 deletions scripts/gcc_10.sh

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/intellij_idea_community.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -eux

IDEA_VERSION='2023.2'
IDEA_VERSION='2023.3.4'

echo "\nInstalling IntelliJ IDEA Community Edition $IDEA_VERSION ...\n"

# download pycharm community edition
Expand Down
14 changes: 7 additions & 7 deletions scripts/pycharm_community.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

set -eux

PYCHARM_VERSION="2023.1.4"
PYCHARM_VERSION="2023.3.3"
PYCHARM_NAME="pycharm-community-${PYCHARM_VERSION}"

echo "\nInstall Pycharm Community $PYCHARM_VERSION ..\n"

# download pycharm community edition
# wget "data.services.jetbrains.com/products/download?code=PCC&platform=linux" -O pycharm.tar.gz
wget -c "https://download.jetbrains.com/python/pycharm-community-${PYCHARM_VERSION}.tar.gz"
wget -c "https://download.jetbrains.com/python/${PYCHARM_NAME}.tar.gz"

# download sha256sum file and verify the checksum
wget "https://download.jetbrains.com/python/pycharm-community-${PYCHARM_VERSION}.tar.gz.sha256" -O expected_sha256sum.txt
sha256sum pycharm-community-${PYCHARM_VERSION}.tar.gz >> actual_sha256sum.txt
wget "https://download.jetbrains.com/python/${PYCHARM_NAME}.tar.gz.sha256" -O expected_sha256sum.txt
sha256sum ${PYCHARM_NAME}.tar.gz >> actual_sha256sum.txt
cat actual_sha256sum.txt | sha256sum -c expected_sha256sum.txt

# extract and keep the files in /opt
tar -zxvf "pycharm-community-${PYCHARM_VERSION}.tar.gz"
mv "pycharm-community-${PYCHARM_VERSION}" /opt
tar -zxvf "${PYCHARM_NAME}.tar.gz"
mv "${PYCHARM_NAME}" /opt

# remove tar and hash files
rm "pycharm-community-${PYCHARM_VERSION}.tar.gz" actual_sha256sum.txt expected_sha256sum.txt
rm "${PYCHARM_NAME}.tar.gz" actual_sha256sum.txt expected_sha256sum.txt

# populate desktop entry
cat > jetbrains-pycharm-ce.desktop << EOF
Expand Down
5 changes: 0 additions & 5 deletions scripts/python3.10.sh

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/python3.11.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -eux

echo "Installing Python 3.11..."

apt install -y python3.11-full
48 changes: 41 additions & 7 deletions scripts/run_order.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,53 @@
# === Upgrade packages ===

dist_upgrade.sh

# === Add multiple repos ===

add_repo.sh

# === Remove unnecessary packages ===

trim.sh

# === Install packages ===

# --- Browsers ---
google_chrome.sh
gcc_10.sh
python3.10.sh

# --- Compilers ---
gcc-12.sh
python3.11.sh
openjdk17.sh
openssh_server.sh

# --- Editors ---
vim.sh
emacs.sh
code.sh
sublime.sh

# --- IDEs ---
codeblocks.sh
geany.sh
pycharm_community.sh
intellij_idea_community.sh
sublime.sh
vim.sh
emacs.sh
geany.sh
eclipse.sh

# --- Additional support packages ---
openssh_server.sh

# === Upgrade packages ===

dist_upgrade.sh

# === Copy universal dot files ===

copy_dots.sh

# === Create users ===

add_users.sh

# === Copy user-specific files ===

copy_admin_scripts.sh
21 changes: 21 additions & 0 deletions scripts/trim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# This script trims down the base Ubuntu 22.04 rootfs.
# It removes unnecessary (for our purposes) packages like
# thunderbird, libreoffice, rhythmbox, aisleriot etc.

set -eux

apt remove -y --purge \
aisleriot \
gnome-mahjongg \
gnome-mines \
gnome-sudoku \
'libreoffice*' \
rhythmbox \
shotwell \
thunderbird \
zsys

# remove unused packages
apt autoremove -y
Loading