From a6b14720883c75bbd93eef65d181472e22c51859 Mon Sep 17 00:00:00 2001 From: 28allday Date: Sat, 28 Mar 2026 12:05:17 +0000 Subject: [PATCH] Add detailed comments to script and comprehensive README Co-Authored-By: Claude Opus 4.6 (1M context) --- DR_MINT.sh | 109 ++++++++++++++++++++++++++++++++++++------ README.md | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 231 insertions(+), 14 deletions(-) create mode 100644 README.md diff --git a/DR_MINT.sh b/DR_MINT.sh index c03d3da..2e8a1c6 100755 --- a/DR_MINT.sh +++ b/DR_MINT.sh @@ -1,17 +1,50 @@ #!/bin/bash +# ============================================================================== +# DaVinci Resolve Installer for Linux Mint 22 +# +# DaVinci Resolve is a professional video editing suite by Blackmagic Design. +# It's distributed as a self-extracting .run file inside a ZIP archive. +# This script automates the installation on Linux Mint 22, handling: +# - FUSE library installation (needed for the AppImage-style installer) +# - Qt5 library installation (Resolve's UI depends on Qt5) +# - ZIP extraction and installer execution +# - Fallback AppImage extraction if FUSE isn't working +# - Library conflict resolution (bundled glib/gio vs system versions) +# +# Prerequisites: +# - Linux Mint 22 +# - DaVinci Resolve Linux ZIP downloaded to ~/Downloads/ +# (download from https://www.blackmagicdesign.com/products/davinciresolve) +# - Internet connection (for installing packages) +# +# Usage: +# chmod +x DR_MINT.sh +# ./DR_MINT.sh +# ============================================================================== -# Script to Install DaVinci Resolve on Linux Mint 22 +set -e # Exit immediately if any command fails -set -e # Exit on any error - -# Variables +# Resolve the real user even when running with sudo. logname returns the +# user who originally logged in, not "root". This ensures we look for the +# ZIP in the correct home directory and set proper file ownership. ACTIVE_USER=$(logname) HOME_DIR=$(eval echo "~$ACTIVE_USER") DOWNLOADS_DIR="$HOME_DIR/Downloads" EXTRACTION_DIR="/opt/resolve" ZIP_FILE_PATTERN="DaVinci_Resolve_*.zip" -# Step 1: Ensure FUSE and libfuse.so.2 are Installed +# ==================== Step 1: FUSE Libraries ==================== +# +# The Resolve .run installer is an AppImage-style archive that normally +# uses FUSE (Filesystem in Userspace) to mount itself and run. Linux Mint +# doesn't always have FUSE installed by default. +# +# We need two things: +# - fuse: The FUSE kernel module and mount tools +# - libfuse2: The userspace library (libfuse.so.2) that AppImages link against +# +# If FUSE still doesn't work after installation (e.g. in a container or +# restricted environment), the script falls back to --appimage-extract later. echo "Checking for FUSE and libfuse.so.2..." if ! dpkg -l | grep -q fuse; then echo "Installing FUSE..." @@ -24,12 +57,28 @@ if [ ! -f /lib/x86_64-linux-gnu/libfuse.so.2 ]; then sudo apt install -y libfuse2 fi -# Step 2: Install Required Qt Libraries +# ==================== Step 2: Qt5 Libraries ==================== +# +# DaVinci Resolve's UI is built with Qt5. On Linux Mint, the required Qt5 +# packages aren't always installed because Mint uses GTK (Cinnamon desktop). +# +# These packages provide: +# - qtbase5-dev + tools: Qt5 core framework and build tools +# - libqt5core/gui/widgets: Qt5 runtime libraries for the UI +# - libqt5network/dbus: Network and D-Bus communication +# - libxrender/xrandr/xi: X11 rendering, monitor, and input extensions +# - libxkbcommon-x11: Keyboard handling under X11 +# - libxcb-*: X11 protocol libraries (low-level display comms) +# - qtwayland5: Wayland support (if running under Wayland) echo "Installing required Qt libraries..." sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5dbus5 \ libxrender1 libxrandr2 libxi6 libxkbcommon-x11-0 libxcb-xinerama0 libxcb-xfixes0 qtwayland5 libxcb-glx0 libxcb-util1 -# Step 3: Navigate to Downloads Directory +# ==================== Step 3: Find the ZIP ==================== +# +# The user must download the Resolve ZIP manually from Blackmagic's website +# (they require filling out a registration form). We look for it in +# ~/Downloads/ which is where browsers save files by default. echo "Navigating to Downloads directory..." if [ ! -d "$DOWNLOADS_DIR" ]; then echo "Error: Downloads directory not found at $DOWNLOADS_DIR." @@ -37,7 +86,11 @@ if [ ! -d "$DOWNLOADS_DIR" ]; then fi cd "$DOWNLOADS_DIR" -# Step 4: Extract DaVinci Resolve ZIP File +# ==================== Step 4: Extract ZIP ==================== +# +# The download is a ZIP containing a .run file (self-extracting installer). +# We extract it to a temporary DaVinci_Resolve/ directory, set ownership +# to the real user (not root), and make files executable. echo "Extracting DaVinci Resolve installer..." ZIP_FILE=$(find . -maxdepth 1 -type f -name "$ZIP_FILE_PATTERN" | head -n 1) if [ -z "$ZIP_FILE" ]; then @@ -49,7 +102,20 @@ unzip -o "$ZIP_FILE" -d DaVinci_Resolve/ chown -R "$ACTIVE_USER:$ACTIVE_USER" DaVinci_Resolve chmod -R 774 DaVinci_Resolve -# Step 5: Run the Installer or Extract AppImage +# ==================== Step 5: Run Installer ==================== +# +# The .run file is an AppImage-style self-extracting archive. We try two +# approaches: +# +# 1. Run it normally with FUSE (-a flag for auto/silent install) +# SKIP_PACKAGE_CHECK=1 bypasses Resolve's built-in distro check +# (it only officially supports CentOS/RHEL, not Mint) +# +# 2. If FUSE fails, fall back to --appimage-extract which extracts the +# contents without needing FUSE, then manually move them to /opt/resolve +# +# Qt environment variables are set so the installer can find the system's +# Qt5 plugins for rendering its UI. echo "Running the DaVinci Resolve installer..." cd DaVinci_Resolve INSTALLER_FILE=$(find . -type f -name "DaVinci_Resolve_*.run" | head -n 1) @@ -60,13 +126,14 @@ fi chmod +x "$INSTALLER_FILE" -# Set Qt platform plugin path and debug settings +# Tell Qt where to find platform plugins so the installer GUI can render. +# QT_DEBUG_PLUGINS=1 prints diagnostic info if plugins fail to load. export QT_DEBUG_PLUGINS=1 export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms export QT_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH -# Attempt to run the installer with FUSE; fallback to extraction +# Try FUSE-based install first, fall back to manual extraction if ! SKIP_PACKAGE_CHECK=1 ./"$INSTALLER_FILE" -a; then echo "FUSE is not functional. Extracting AppImage contents..." sudo mkdir -p "$EXTRACTION_DIR" @@ -75,7 +142,19 @@ if ! SKIP_PACKAGE_CHECK=1 ./"$INSTALLER_FILE" -a; then sudo chown -R root:root "$EXTRACTION_DIR" fi -# Step 6: Resolve Library Conflicts +# ==================== Step 6: Library Conflict Resolution ==================== +# +# Resolve bundles its own versions of glib/gio/gmodule libraries, but these +# are often older than what Linux Mint provides. The bundled versions can +# cause crashes or "symbol not found" errors when they conflict with +# system libraries that other parts of Resolve also load. +# +# The fix: move Resolve's bundled gio and gmodule out of the way, and +# copy the system's glib into Resolve's lib directory. This is safe because +# glib has a very stable C ABI — newer versions are backwards-compatible. +# +# NOTE: We do NOT touch Resolve's bundled libc++/libc++abi — those have +# C++ ABI dependencies and replacing them would cause crashes. echo "Resolving library conflicts..." if [ -d "$EXTRACTION_DIR/libs" ]; then cd "$EXTRACTION_DIR/libs" @@ -83,7 +162,6 @@ if [ -d "$EXTRACTION_DIR/libs" ]; then sudo mv libgio* not_used || true sudo mv libgmodule* not_used || true - # Replace with system versions if [ -f /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 ]; then sudo cp /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 "$EXTRACTION_DIR/libs/" else @@ -93,7 +171,10 @@ else echo "Error: Installation directory $EXTRACTION_DIR/libs not found. Skipping library conflict resolution." fi -# Step 7: Cleanup +# ==================== Step 7: Cleanup ==================== +# +# Remove the temporary extraction directory from ~/Downloads/. +# The installed application stays at /opt/resolve. echo "Cleaning up installation files..." cd "$DOWNLOADS_DIR" rm -rf DaVinci_Resolve diff --git a/README.md b/README.md new file mode 100644 index 0000000..062b128 --- /dev/null +++ b/README.md @@ -0,0 +1,136 @@ +# DaVinci Resolve - Linux Mint + +Install [DaVinci Resolve](https://www.blackmagicdesign.com/products/davinciresolve) on Linux Mint 22 with automatic dependency installation and library conflict resolution. + +## Requirements + +- **OS**: Linux Mint 22 +- **DaVinci Resolve ZIP**: Downloaded from Blackmagic's website to `~/Downloads/` + +## Quick Start + +1. **Download DaVinci Resolve** from [blackmagicdesign.com](https://www.blackmagicdesign.com/products/davinciresolve) + - Choose "DaVinci Resolve" (free) or "DaVinci Resolve Studio" (paid) + - Select **Linux** and download the ZIP file + - Save it to `~/Downloads/` + +2. **Run the installer**: +```bash +git clone https://github.com/28allday/DaVinci-Resolve-Linux-Mint.git +cd DaVinci-Resolve-Linux-Mint +chmod +x DR_MINT.sh +./DR_MINT.sh +``` + +## What It Does + +### 1. Installs FUSE Libraries + +The Resolve installer is an AppImage-style archive that needs FUSE to mount itself. If FUSE isn't available, the script falls back to extracting the contents manually. + +| Package | Purpose | +|---------|---------| +| `fuse` | FUSE kernel module and mount tools | +| `libfuse2` | Userspace library (`libfuse.so.2`) for AppImage support | + +### 2. Installs Qt5 Libraries + +Resolve's UI is built with Qt5. Linux Mint uses GTK (Cinnamon desktop) so Qt5 libraries aren't always present. + +| Package | Purpose | +|---------|---------| +| `qtbase5-dev` + tools | Qt5 core framework | +| `libqt5core5a`, `libqt5gui5`, `libqt5widgets5` | Qt5 runtime libraries | +| `libqt5network5`, `libqt5dbus5` | Network and D-Bus communication | +| `libxrender1`, `libxrandr2`, `libxi6` | X11 rendering, monitor, and input extensions | +| `libxkbcommon-x11-0`, `libxcb-*` | Keyboard and X11 protocol libraries | +| `qtwayland5` | Wayland support | + +### 3. Extracts and Runs Installer + +- Finds the Resolve ZIP in `~/Downloads/` +- Extracts the ZIP to get the `.run` installer +- Tries running the installer with FUSE first +- Falls back to `--appimage-extract` if FUSE doesn't work +- Installs to `/opt/resolve` + +### 4. Resolves Library Conflicts + +Resolve bundles its own glib/gio libraries which conflict with Mint's newer system versions. The script: + +| Library | Action | Why | +|---------|--------|-----| +| `libgio-2.0.so` | Moved to `not_used/` | Bundled version conflicts with system | +| `libgmodule-2.0.so` | Moved to `not_used/` | Bundled version conflicts with system | +| `libglib-2.0.so.0` | Replaced with system copy | Stable C ABI, safe to use system version | + +### 5. Cleans Up + +Removes the temporary extraction directory from `~/Downloads/`. The installed application stays at `/opt/resolve`. + +## Files Installed + +| Path | Purpose | +|------|---------| +| `/opt/resolve/` | Main application directory | +| `/opt/resolve/bin/resolve` | Resolve binary | +| `/opt/resolve/libs/` | Bundled libraries | +| `/opt/resolve/libs/not_used/` | Conflicting libraries moved out of the way | + +## Troubleshooting + +### Resolve won't start / crashes immediately + +- Try launching from terminal to see errors: `/opt/resolve/bin/resolve` +- Check if GPU drivers are installed: `nvidia-smi` (NVIDIA) or `glxinfo | grep renderer` (AMD/Intel) + +### "Cannot open display" or Qt plugin errors + +The Qt environment variables may not be set. Try: +```bash +export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms +/opt/resolve/bin/resolve +``` + +### Installer says "unsupported distribution" + +The script sets `SKIP_PACKAGE_CHECK=1` to bypass this. If you still see it, the fallback extraction should handle it automatically. + +### FUSE errors during installation + +If you see FUSE-related errors, the script automatically falls back to `--appimage-extract`. No action needed. + +### Missing library errors + +Re-run the script — it will reinstall dependencies and redo the library conflict resolution. + +## Updating Resolve + +1. Download the new version ZIP from Blackmagic's website to `~/Downloads/` +2. Run the installer again: +```bash +./DR_MINT.sh +``` + +## Uninstalling + +```bash +# Remove application +sudo rm -rf /opt/resolve + +# Remove desktop entries (if created by Resolve's installer) +sudo rm -f /usr/share/applications/DaVinciResolve.desktop +rm -f ~/.local/share/applications/DaVinciResolve.desktop + +# Remove user data (WARNING: deletes all projects and settings) +rm -rf ~/.local/share/DaVinciResolve +``` + +## Credits + +- [Blackmagic Design](https://www.blackmagicdesign.com/) - DaVinci Resolve +- [Linux Mint](https://linuxmint.com/) - Target distribution + +## License + +This project is provided as-is.