Created
February 4, 2026 13:17
-
-
Save szeyu/9b1d84993dccb4c03697271164cc004d to your computer and use it in GitHub Desktop.
Ubuntu Linux Auto Update Setup
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 -euo pipefail | |
| # --------------------------------------------- | |
| # Enable Cursor APT source and upgrade package | |
| # --------------------------------------------- | |
| SOURCES_FILE="/etc/apt/sources.list.d/cursor.sources" | |
| PACKAGE_NAME="cursor" | |
| echo "▶ Enabling Cursor APT source..." | |
| if [ ! -f "$SOURCES_FILE" ]; then | |
| echo "✖ Cursor sources file not found: $SOURCES_FILE" | |
| exit 1 | |
| fi | |
| # Enable the source (idempotent) | |
| sudo sed -i 's/^Enabled:\s*no$/Enabled: yes/' "$SOURCES_FILE" | |
| echo "▶ Updating package lists..." | |
| sudo apt update | |
| echo "▶ Upgrading Cursor..." | |
| sudo apt upgrade -y "$PACKAGE_NAME" | |
| echo "✔ Cursor is up to date." |
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 -euo pipefail | |
| # --------------------------------------------- | |
| # ONLYOFFICE Desktop Editors APT setup & upgrade | |
| # --------------------------------------------- | |
| KEYRING_DIR="/etc/apt/keyrings" | |
| KEYRING_PATH="$KEYRING_DIR/onlyoffice.gpg" | |
| REPO_FILE="/etc/apt/sources.list.d/onlyoffice.list" | |
| REPO_URL="https://download.onlyoffice.com/repo/debian" | |
| GPG_KEY_URL="https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE" | |
| PACKAGE_NAME="onlyoffice-desktopeditors" | |
| echo "▶ Setting up ONLYOFFICE APT repository..." | |
| # Create keyring directory if missing | |
| if [ ! -d "$KEYRING_DIR" ]; then | |
| sudo mkdir -p -m 755 "$KEYRING_DIR" | |
| fi | |
| # Import GPG key (overwrite safely if exists) | |
| wget -qO- "$GPG_KEY_URL" | sudo gpg --dearmor -o "$KEYRING_PATH" | |
| # Add repository (idempotent) | |
| if [ ! -f "$REPO_FILE" ]; then | |
| echo "deb [signed-by=$KEYRING_PATH] $REPO_URL squeeze main" \ | |
| | sudo tee "$REPO_FILE" > /dev/null | |
| fi | |
| echo "▶ Updating package lists..." | |
| sudo apt update | |
| echo "▶ Installing or upgrading ONLYOFFICE Desktop Editors..." | |
| sudo apt install -y "$PACKAGE_NAME" | |
| echo "✔ ONLYOFFICE Desktop Editors is installed and up to date." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment