Skip to content

Instantly share code, notes, and snippets.

@Blayung
Created August 1, 2025 13:13
Show Gist options
  • Select an option

  • Save Blayung/923dce086256ff237ff42f31f890071d to your computer and use it in GitHub Desktop.

Select an option

Save Blayung/923dce086256ff237ff42f31f890071d to your computer and use it in GitHub Desktop.
Automatic updating of the broken discord package on arch linux.
#!/bin/python3
import os, requests, io, tarfile, shutil
if os.geteuid() != 0:
print("This script needs to be run as root!")
exit()
tarfile.open(fileobj = io.BytesIO(requests.get("https://discord.com/api/download?platform=linux&format=tar.gz").content)).extractall(filter = "data")
shutil.rmtree("/opt/discord", ignore_errors = True)
shutil.move("Discord", "/opt/discord")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment