Skip to content

Commit 4536887

Browse files
committed
Update software installer script
1 parent f83bb60 commit 4536887

File tree

1 file changed

+39
-10
lines changed

1 file changed

+39
-10
lines changed

apt/install_software.sh

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
# https://flatpak.org/setup/Kubuntu
66

77
# These have to be installed manually:
8-
# Google Chrome, Steam, TeamViewer
8+
# TeamViewer
99

1010
if [ "${EUID}" -ne 0 ]; then
1111
echo "This script should be run as root."
@@ -20,8 +20,18 @@ else
2020
fi
2121
set -u
2222

23-
echo "Installing apt packages."
23+
echo "Configuring apt/dpkg architectures."
24+
ARCH="$(uname -i)"
25+
FOREIGN_ARCHS="$(dpkg --print-foreign-architectures)}"
26+
if [ "${ARCH}" = "x86_64" ] && [[ "${FOREIGN_ARCHS}" != *"i386"* ]]; then
27+
echo "Detected x86_64 architecture where i386 is not enabled. Enabling i386."
28+
dpkg --add-architecture i386
29+
fi
30+
31+
echo "Updating apt repositories."
2432
apt update
33+
34+
echo "Constructing the list of apt packages to install."
2535
BASE_PACKAGES=(
2636
# Servers should have git-gui too for X11 forwarding.
2737
"apt-transport-https" "bleachbit" "ca-certificates" "git" "git-gui" "htop" "mosh" "openssh-server" "screen" "ufw"
@@ -36,27 +46,46 @@ PYTHON_PACKAGES=(
3646
"python3-dev" "python3-setuptools" "python3-venv" "python3-wheel"
3747
)
3848
UTILS_PACKAGES=(
39-
"autojump" "autossh" "boinc-client-opencl" "cifs-utils" "curl" "git-delta" "gpg-agent" "links"
49+
"autojump" "autossh" "cifs-utils" "curl" "git-delta" "gpg-agent" "links"
4050
"mtr-tiny" "optipng" "pandoc" "texlive-full" "traceroute" "wget" "wireguard" "xindy" "yt-dlp" "zsh"
4151
)
4252
APT_PACKAGES=("${BASE_PACKAGES[@]}" "${DEV_PACKAGES[@]}" "${DOCKER_PACKAGES[@]}" "${GUI_PACKAGES[@]}" "${PYTHON_PACKAGES[@]}" "${UTILS_PACKAGES[@]}")
4353

4454
# If running in a desktop environment. All GUI programs should go here.
4555
if [ "${IS_DESKTOP}" = true ]; then
4656
APT_PACKAGES+=(
47-
"boinc" "clamtk" "filelight" "filezilla" "freerdp2-wayland" "gimp" "inkscape" "kde-config-flatpak"
48-
"keepassxc" "ktorrent" "libenchant-2-voikko" "libreoffice" "libreoffice-help-fi" "libreoffice-voikko"
49-
"mumble" "network-manager-openvpn" "obs-studio" "remmina" "remmina-plugin-kwallet" "signal-desktop"
57+
"clamtk" "filelight" "filezilla" "gimp" "inkscape"
58+
"keepassxc" "ktorrent" "libenchant-2-voikko"
59+
"libreoffice" "libreoffice-help-en-us" "libreoffice-help-fi" "libreoffice-voikko"
60+
"mumble" "network-manager-openvpn" "remmina" "signal-desktop" "steam"
5061
"synaptic" "texmaker" "tikzit" "tmispell-voikko" "vlc"
5162
)
63+
if [ "${XDE_CURRENT_DESKTOP}" = "KDE" ]; then
64+
APT_PACKAGES+=("kde-config-flatpak" "remmina-plugin-kwallet")
65+
fi
66+
if [ "${XDE_SESSION_TYPE}" = "wayland" ]; then
67+
APT_PACKAGES+=("freerdp2-wayland")
68+
fi
69+
if dpkg -s google-chrome-stable &> /dev/null; then
70+
echo "Google Chrome is already installed."
71+
else
72+
echo "Adding Google Chrome to the installation list."
73+
CHROME_DEB="google-chrome-stable_current_amd64.deb"
74+
CHROME_DEB_PATH="${SCRIPT_DIR}/${CHROME_DEB}"
75+
wget "https://dl.google.com/linux/direct/${CHROME_DEB}" -O "${CHROME_DEB_PATH}"
76+
APT_PACKAGES+=("${CHROME_DEB_PATH}")
77+
fi
5278
fi
5379

5480
# If running on physical hardware
5581
if ! grep -q "hypervisor" /proc/cpuinfo; then
5682
APT_PACKAGES+=(
57-
"bluetooth" "clinfo" "clpeak" "cutecom" "exfatprogs" "gdisk" "gnome-disk-utility" "gparted"
58-
"lm-sensors" "pipewire-audio" "pocl-opencl-icd" "powertop" "rpi-imager" "s-tui" "stress" "usbtop"
59-
)
83+
"bluetooth" "boinc-client-opencl" "clinfo" "clpeak" "exfatprogs" "gdisk"
84+
"lm-sensors" "pocl-opencl-icd" "powertop" "s-tui" "stress" "usbtop"
85+
)
86+
if [ "${IS_DESKTOP}" = true ]; then
87+
APT_PACKAGES+=("boinc" "cutecom" "gnome-disk-utility" "gparted" "obs-studio" "pipewire-audio" "rpi-imager")
88+
fi
6089
fi
6190
# If running on a laptop
6291
if [ "$(hostnamectl chassis)" = "laptop" ]; then
@@ -71,9 +100,9 @@ if command -v nvidia-smi &> /dev/null; then
71100
APT_PACKAGES+=("boinc-client-nvidia-cuda")
72101
fi
73102

103+
echo "Installing apt packages."
74104
apt install "${APT_PACKAGES[@]}"
75105

76-
77106
if [ "${IS_DESKTOP}" = true ]; then
78107
echo "Installing Snap packages."
79108
snap install pycharm-professional --classic

0 commit comments

Comments
 (0)