Skip to content

Instantly share code, notes, and snippets.

@broskisworld
Created August 2, 2026 23:21
Show Gist options
  • Select an option

  • Save broskisworld/a610d2e4aaa015ae840ccd54e616e34f to your computer and use it in GitHub Desktop.

Select an option

Save broskisworld/a610d2e4aaa015ae840ccd54e616e34f to your computer and use it in GitHub Desktop.
DaVinci Resolve installer for Ubuntu 24.04+ (handles t64-renamed dependency packages)
#!/usr/bin/env bash
#
# DaVinci Resolve installer for Ubuntu 24.04+ (t64-aware)
# =========================================================
#
# Ubuntu 24.04+ renamed several libraries with a "t64" suffix as part of the
# 64-bit time_t transition (e.g. libapr1 -> libapr1t64). DaVinci Resolve's
# bundled installer checks for dependencies by their old, literal names, so
# it reports them "missing" even when the real library is installed under
# its new name -- and blindly force-installing the old names can drag in
# broken, unrelated packages from stale/foreign apt repos.
#
# This script reads DaVinci Resolve's OWN dependency list straight out of
# its installer (not a hardcoded copy, so it can't go stale), installs
# whatever's genuinely missing (preferring the real t64 package where that's
# what Ubuntu actually ships), independently re-verifies every single
# required package is really present, and only then launches the installer
# -- aborting instead of proceeding if anything is truly unresolvable.
#
# Usage:
# ./install.sh [path/to/DaVinci_Resolve_*_Linux.run]
#
# With no argument, it looks for a DaVinci_Resolve_*_Linux.run file in the
# same directory as this script (searching one level of subdirectories
# too, e.g. a folder you unzipped the download into).
#
# Requirements: Ubuntu/Debian (apt-based), sudo access.
#
# Example:
# ./install.sh
# ./install.sh ~/Downloads/DaVinci_Resolve_21.0.3_Linux.run
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
usage() {
sed -n '2,31p' "${BASH_SOURCE[0]}" | sed 's/^#//; s/^ //'
}
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
usage
exit 0
fi
if [[ $# -gt 0 ]]; then
INSTALLER="$1"
if [[ ! -f "$INSTALLER" ]]; then
echo "Installer not found: $INSTALLER" >&2
exit 1
fi
else
echo "No installer path given -- searching $SCRIPT_DIR ..."
INSTALLER=$(find "$SCRIPT_DIR" -maxdepth 2 -name 'DaVinci_Resolve_*_Linux.run' -print -quit)
if [[ -z "$INSTALLER" ]]; then
echo "Couldn't find a DaVinci_Resolve_*_Linux.run installer under $SCRIPT_DIR." >&2
usage >&2
exit 1
fi
fi
echo "Using installer: $INSTALLER"
chmod +x "$INSTALLER"
WORKDIR=$(mktemp -d)
trap 'rm -rf "$WORKDIR"' EXIT
echo "Reading the installer's own dependency list..."
( cd "$WORKDIR" && "$INSTALLER" --appimage-extract AppRun >/dev/null )
APPRUN="$WORKDIR/squashfs-root/AppRun"
if [[ ! -f "$APPRUN" ]]; then
echo "Could not extract AppRun from the installer." >&2
exit 1
fi
mapfile -t REQUIRED < <(
sed -n '/^function check_ubuntu_package_deps/,/^}/p' "$APPRUN" \
| sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//' \
| grep -E '^[A-Za-z0-9][A-Za-z0-9.+_-]*-[0-9]+\.[0-9]+\.[0-9]+$'
)
if [[ ${#REQUIRED[@]} -eq 0 ]]; then
echo "Couldn't parse a package list out of the installer's AppRun script." >&2
exit 1
fi
echo "Installer requires ${#REQUIRED[@]} packages."
ver_lteq() {
[[ "$1" == "$(printf '%s\n%s\n' "$1" "$2" | sort -V | head -n1)" ]]
}
installed_version() {
# --show can print one line per installed architecture (this box has
# both amd64 and i386 builds of some libs) -- take the first.
dpkg-query --showformat='${Version}\n' --show "$1" 2>/dev/null | head -n1
}
has_candidate() {
local policy
policy=$(apt-cache policy "$1" 2>/dev/null)
[[ "$policy" == *"Candidate:"* && "$policy" != *"Candidate: (none)"* ]]
}
echo "Updating package lists..."
sudo apt update
echo "Resolving what actually needs installing..."
TO_INSTALL=()
for entry in "${REQUIRED[@]}"; do
name="${entry%-*}"
reqver="${entry##*-}"
v=$(installed_version "$name")
[[ -n "$v" ]] && ver_lteq "$reqver" "$v" && continue
t64="${name}t64"
tv=$(installed_version "$t64")
[[ -n "$tv" ]] && ver_lteq "$reqver" "$tv" && continue
if has_candidate "$t64"; then
TO_INSTALL+=("$t64")
elif has_candidate "$name"; then
TO_INSTALL+=("$name")
else
echo "No installable package found for '$name' (required >= $reqver, checked '$name' and '$t64')." >&2
exit 1
fi
done
if [[ ${#TO_INSTALL[@]} -gt 0 ]]; then
echo "Installing: ${TO_INSTALL[*]}"
sudo apt install -y "${TO_INSTALL[@]}"
else
echo "Nothing to install -- all requirements already satisfied."
fi
echo
echo "Verifying all ${#REQUIRED[@]} required packages..."
RENAMED_OK=()
PROBLEMS=()
for entry in "${REQUIRED[@]}"; do
name="${entry%-*}"
reqver="${entry##*-}"
v=$(installed_version "$name")
if [[ -n "$v" ]] && ver_lteq "$reqver" "$v"; then
continue
fi
t64="${name}t64"
tv=$(installed_version "$t64")
if [[ -n "$tv" ]] && ver_lteq "$reqver" "$tv"; then
RENAMED_OK+=("$name (satisfied by $t64 $tv)")
continue
fi
PROBLEMS+=("$name (required >= $reqver, not found under '$name' or '$t64')")
done
if [[ ${#RENAMED_OK[@]} -gt 0 ]]; then
echo
echo "These are genuinely installed, but under Ubuntu's renamed t64 package --"
echo "the installer's own check only looks for the literal name, so it will"
echo "still report them missing unless that check is bypassed:"
printf ' %s\n' "${RENAMED_OK[@]}"
fi
if [[ ${#PROBLEMS[@]} -gt 0 ]]; then
echo
echo "The following required packages are genuinely missing and could not be resolved:" >&2
printf ' %s\n' "${PROBLEMS[@]}" >&2
exit 1
fi
echo
echo "All ${#REQUIRED[@]} required packages verified present."
echo "Launching $INSTALLER"
if [[ ${#RENAMED_OK[@]} -gt 0 ]]; then
# We've independently verified everything the installer's naming check
# would flag as missing, so it's safe to use its documented bypass.
sudo env SKIP_PACKAGE_CHECK=1 "$INSTALLER"
else
sudo "$INSTALLER"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment