Created
January 19, 2026 13:40
-
-
Save otnamhcar/38e46f161f2d3241caad5678389347ca to your computer and use it in GitHub Desktop.
install telegram desktop from github on linux mint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| APP_NAME="Telegram Desktop" | |
| INSTALL_DIR="/opt/telegram" | |
| BIN_LINK="/usr/local/bin/telegram" | |
| DESKTOP_FILE="/usr/share/applications/telegram.desktop" | |
| ICON_DIR="/usr/share/icons/hicolor/256x256/apps" | |
| ICON_PATH="$ICON_DIR/telegram.png" | |
| TMP_DIR="$(mktemp -d)" | |
| GITHUB_API="https://api.github.com/repos/telegramdesktop/tdesktop/releases/latest" | |
| echo "[+] Fetching latest Telegram Desktop release..." | |
| TAR_URL=$(curl -s "$GITHUB_API" \ | |
| | grep browser_download_url \ | |
| | grep linux \ | |
| | grep tar.xz \ | |
| | cut -d '"' -f 4) | |
| if [[ -z "$TAR_URL" ]]; then | |
| echo "[!] Failed to detect Telegram Desktop release" | |
| exit 1 | |
| fi | |
| echo "[+] Downloading: $TAR_URL" | |
| curl -L "$TAR_URL" -o "$TMP_DIR/telegram.tar.xz" | |
| echo "[+] Extracting archive..." | |
| tar -xf "$TMP_DIR/telegram.tar.xz" -C "$TMP_DIR" | |
| echo "[+] Installing to $INSTALL_DIR" | |
| sudo rm -rf "$INSTALL_DIR" | |
| sudo mv "$TMP_DIR/Telegram" "$INSTALL_DIR" | |
| sudo chmod +x "$INSTALL_DIR"/* | |
| echo "[+] Creating symlink $BIN_LINK" | |
| sudo ln -sf "$INSTALL_DIR/Telegram" "$BIN_LINK" | |
| echo "[+] Installing icon" | |
| sudo mkdir -p "$ICON_DIR" | |
| sudo curl -L https://desktop.telegram.org/img/td_logo.png -o "$ICON_PATH" | |
| echo "[+] Creating desktop entry" | |
| sudo tee "$DESKTOP_FILE" >/dev/null <<EOF | |
| [Desktop Entry] | |
| Name=Telegram Desktop | |
| Comment=Official Telegram Desktop (Binary) | |
| Exec=$BIN_LINK | |
| Icon=telegram | |
| Terminal=false | |
| Type=Application | |
| Categories=Network;InstantMessaging; | |
| StartupWMClass=TelegramDesktop | |
| EOF | |
| echo "[+] Updating desktop database" | |
| sudo update-desktop-database | |
| echo "[✓] Telegram Desktop installed successfully" | |
| echo " Run: telegram" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment