Skip to content

Instantly share code, notes, and snippets.

@SiKing
Last active September 11, 2025 15:35
Show Gist options
  • Save SiKing/345e570054d463e1786e43f28934192a to your computer and use it in GitHub Desktop.
Save SiKing/345e570054d463e1786e43f28934192a to your computer and use it in GitHub Desktop.
Discord on Linux does not (and **will** not) have a PPA. Drop this script in your /etc/cron.daily/ and forget about it.
#!/bin/bash -e
echo "Are we superuser?"
[[ $EUID -eq 0 ]]
echo "OK"
# Make sure cleanup runs even if the script exits abnormally
trap "rm --force /tmp/discord.deb" EXIT
# Find latest package version
nextVersion=$( curl --head --silent --output /dev/null --write-out '%header{location}' https://discord.com/api/download?platform=linux | \
awk -F '/' '{ print $(NF-1) }' )
# Find intalled package version
instVersion=$( dpkg-query --showformat='${Version}' --show discord )
if dpkg --compare-versions "$nextVersion" gt "$instVersion"; then
curl --get --location --silent --output /tmp/discord.deb https://discord.com/api/download?platform=linux
dpkg --install /tmp/discord.deb
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment