Skip to content

Instantly share code, notes, and snippets.

@feynon
Created November 5, 2025 11:53
Show Gist options
  • Select an option

  • Save feynon/3f15b302a32248f1bf94bc9a0c0a0414 to your computer and use it in GitHub Desktop.

Select an option

Save feynon/3f15b302a32248f1bf94bc9a0c0a0414 to your computer and use it in GitHub Desktop.
lmstudio-install.sh
#!/usr/bin/env bash
set -e
# --- CONFIG ---
APPIMAGE_PATH="$1"
INSTALL_DIR="/usr/local/bin"
# --- CHECKS ---
if [ -z "$APPIMAGE_PATH" ]; then
echo "Usage: sudo ./install-appimage.sh <path-to-AppImage>"
exit 1
fi
if [ ! -f "$APPIMAGE_PATH" ]; then
echo "Error: File not found at '$APPIMAGE_PATH'"
exit 1
fi
# --- INSTALL FUSE IF MISSING ---
if ! dpkg -s libfuse2 >/dev/null 2>&1; then
echo "Installing required dependency: libfuse2"
sudo apt update && sudo apt install -y libfuse2
fi
# --- MAKE EXECUTABLE ---
chmod +x "$APPIMAGE_PATH"
# --- COPY AND RENAME ---
APP_NAME=$(basename "$APPIMAGE_PATH" .AppImage)
TARGET_PATH="$INSTALL_DIR/$APP_NAME"
echo "Installing $APP_NAME to $INSTALL_DIR ..."
sudo cp "$APPIMAGE_PATH" "$TARGET_PATH"
sudo chmod +x "$TARGET_PATH"
# --- VERIFY INSTALLATION ---
if command -v "$APP_NAME" >/dev/null 2>&1; then
echo "✅ $APP_NAME installed successfully!"
echo "You can now run it by typing: $APP_NAME"
else
echo "⚠️ Installation complete, but the command may not be on your PATH yet."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment