Skip to content

Instantly share code, notes, and snippets.

@Rmlyy
Created April 24, 2022 14:37
Show Gist options
  • Save Rmlyy/85a98271c6e6c81d3a6b2f8ee40f6ffe to your computer and use it in GitHub Desktop.
Save Rmlyy/85a98271c6e6c81d3a6b2f8ee40f6ffe to your computer and use it in GitHub Desktop.
Script to install Discord on Debian 11
#!/bin/bash
if [ $EUID -ne 0 ]
then
echo "This script must be run as root"
exit
fi
if ! grep -q 11 '/etc/debian_version'
then
echo "You're not using Debian 11. This script was only tested on Debian 11"
read -p "Continue? [Y/N] " -n 1 -r
echo # Add a new line so it doesn't look weird
if [[ $REPLY =~ ^[Nn]$ ]]
then
echo "Exiting"
exit
fi
fi
echo "Running apt update"
apt update
echo "Checking for wget"
if ! [ -x "$(command -v wget)" ]
then
echo "wget is not installed"
echo "installing wget"
apt install wget -y
else
echo "wget is installed"
fi
echo "Installing dependencies (apt)"
apt install libgconf-2-4 libc++1 libdbusmenu-glib4 libdbusmenu-gtk4 -y
echo "Create temporary directory"
mkdir ~/.temp
echo "Downloading dependencies (deb, dpkg)"
wget -O ~/.temp/libindicator7.deb http://ftp.de.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_amd64.deb
wget -O ~/.temp/libappindicator1.deb http://ftp.de.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-7_amd64.deb
echo "Installing dependencies (deb, dpkg)"
dpkg -i ~/.temp/libindicator7.deb
dpkg -i ~/.temp/libappindicator1.deb
echo "Downloading the latest version of Discord"
wget -O ~/.temp/discord.deb 'https://discord.com/api/download?platform=linux&format=deb'
echo "Installing Discord"
dpkg -i ~/.temp/discord.deb
echo "Delete temporary directory"
rm -rf ~/.temp
echo "Discord should be installed successfully. Have fun! :)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment