Skip to content

Instantly share code, notes, and snippets.

@denis2glez
Last active June 11, 2022 18:46
Show Gist options
  • Save denis2glez/15789e72ef974a75ba8e021d9f8115d1 to your computer and use it in GitHub Desktop.
Save denis2glez/15789e72ef974a75ba8e021d9f8115d1 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "⚠️ This script must be run as root! Please, try again."
exit 1
fi
echo "✔️ Getting the latest updates..."
apt-get update
apt-get upgrade -y
apt-get clean
# Install a few utilities
apt-get install -y curl wget gpg apt-transport-https dialog
cmd=(dialog --separate-output --checklist "Select the software you want to install:" 22 76 16)
# Set the default options
options=(
1 "Remove snaps" off
2 "Utilities" on
3 "ZSH" on
4 "C/C++ dev" on
5 "Rust dev" on
6 "Go dev" on
7 "Extra apps" on
8 "Google Chrome" on
9 "VS Code" on
10 "Latex tools" on
)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices; do
case $choice in
1) # Remove snaps
echo "Removing snaps"
# Disable snapd related services
systemctl disable snapd.service
systemctl disable snapd.socket
systemctl disable snapd.seeded.service
# Remove each snap
snap remove firefox
snap remove snap-store
snap remove gtk-common-themes
snap remove gnome-3-38-2004
snap remove core18
snap remove snapd-desktop-integration
# Remove completely snapd
rm -rf /var/cache/snapd/
apt-get autoremove --purge snapd
rm -rf ~/snap
apt-get autoremove
;;
2) # Utilities
echo "Installing utilities"
apt-get install -y fonts-firacode neovim fzf powerline tmux lshw hwinfo ffmpeg youtube-dl
apt-get install -y git ripgrep pkg-config
;;
3) # ZSH
echo "Installing ZSH"
apt-get install -y zsh zsh-autosuggestions zsh-syntax-highlighting
chsh -s /bin/zsh
;;
4) # C/C++ dev
echo "Installing C/C++ dev tools"
apt-get install -y gcc g++ gdb cmake ninja-build
apt-get install -y clang-format clang-tidy clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 lld lldb
;;
5) # Rust dev
echo "Installing Rust dev tools"
sudo -u $SUDO_USER curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sudo -u $SUDO_USER sh -s -- -y
;;
6) # Go dev
echo "Installing Go dev tools"
apt-get install -y golang-go
;;
7) # Extra apps
echo "Installing extra apps"
apt-get install -y gnome-tweaks gnome-weather gnome-clocks gnome-maps
apt-get install -y dconf-editor synaptic apt-xapian-index
apt-get install -y vlc lollypop foliate telegram-desktop
;;
8) # Google Chrome
echo "Installing Google Chrome"
wget -O- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor | tee /usr/share/keyrings/google-chrome-keyring.gpg
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
apt-get update
apt-get install google-chrome-stable -y
;;
9) # VS Code
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg
install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
apt-get update
apt-get install code # or code-insiders
;;
10) # Latex
echo "Installing Latex tools"
apt-get install -y texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-extra-utils
apt-get install -y latexmk lmodern
;;
esac
echo "✔️ Cleaning apt cache..."
apt-get clean
done
echo "✔️ Cleaning the system..."
apt-get clean
apt-get autoremove -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment