Skip to content

Instantly share code, notes, and snippets.

@otnamhcar
Created January 19, 2026 13:41
Show Gist options
  • Select an option

  • Save otnamhcar/ef12ccb60f53e0d86cfe75a334812038 to your computer and use it in GitHub Desktop.

Select an option

Save otnamhcar/ef12ccb60f53e0d86cfe75a334812038 to your computer and use it in GitHub Desktop.
Script UNINSTALL — uninstall-telegram.sh
#!/usr/bin/env bash
set -e
INSTALL_DIR="/opt/telegram"
BIN_LINK="/usr/local/bin/telegram"
DESKTOP_FILE="/usr/share/applications/telegram.desktop"
ICON_PATH="/usr/share/icons/hicolor/256x256/apps/telegram.png"
echo "[+] Removing Telegram Desktop installation..."
sudo rm -rf "$INSTALL_DIR"
sudo rm -f "$BIN_LINK"
sudo rm -f "$DESKTOP_FILE"
sudo rm -f "$ICON_PATH"
echo "[+] Updating desktop database"
sudo update-desktop-database
echo "[✓] Telegram Desktop uninstalled successfully"
echo "[i] User data preserved at:"
echo " ~/.local/share/TelegramDesktop/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment