Install yt-dlp on Linux Without Your Distro's Stale Package
Quick answer
On a rolling-release distribution, the package manager is fine. On anything with frozen versions — Debian stable, Ubuntu LTS, RHEL — the packaged yt-dlp is old enough that YouTube downloads simply fail. Install a build that updates itself instead:
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
yt-dlp --version
Why the packaged version is the problem
Distributions freeze package versions for the lifetime of a release. For a C library that is exactly right. For yt-dlp it is fatal: the program's job is to track sites that change every few weeks, and a build frozen eighteen months ago is tracking a version of YouTube that no longer exists.
The symptoms are not obviously "this is out of date". They are nsig extraction failed, unable to extract player response, and downloads that quietly cap at 360p. Every one of them is people debugging a package manager's release policy.
| Distribution | Packaged yt-dlp | Recommendation |
|---|---|---|
| Arch, Manjaro | Days behind | pacman -S yt-dlp |
| Fedora | Weeks behind | dnf install yt-dlp |
| openSUSE Tumbleweed | Days behind | zypper install yt-dlp |
| Debian stable | A year or more | Binary or pipx |
| Ubuntu LTS | A year or more | Binary or pipx |
| RHEL, Rocky, Alma | Not packaged | Binary |
Ubuntu and Debian specifically have enough going on — pipx, the externally-managed-environment error, the PPA question — to deserve their own page.
The standalone binary
One self-contained file with Python bundled inside. Nothing to install first, and it updates itself:
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
mkdir -p ~/.local/bin
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o ~/.local/bin/yt-dlp
chmod +x ~/.local/bin/yt-dlp
If the second form gives "command not found", ~/.local/bin is not on your PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
pipx
An isolated virtual environment per tool, without you having to manage one. The right answer if
you would rather not have an unmanaged binary in /usr/local/bin:
sudo apt install pipx # or dnf, pacman, zypper
pipx ensurepath
pipx install yt-dlp
pipx upgrade yt-dlp
ffmpeg
Install this from the package manager. Unlike yt-dlp it is not chasing a moving target, so a distribution build is fine:
sudo apt install ffmpeg # Debian, Ubuntu
sudo dnf install ffmpeg # Fedora
sudo pacman -S ffmpeg # Arch
sudo zypper install ffmpeg # openSUSE
On Fedora and RHEL, ffmpeg lives in RPM Fusion rather than the default repositories — enable it first. Without ffmpeg, yt-dlp cannot merge streams and every download caps at 360p.
Two installs at once
Installing the binary without removing the packaged one leaves two, and which runs depends on PATH order. That produces "I updated and it is still the old version", repeatedly:
which -a yt-dlp
yt-dlp --version
If more than one path comes back, remove the packaged one —
sudo apt remove yt-dlp or your distribution's equivalent.
Keeping it current
yt-dlp -U
yt-dlp --update-to nightly
Nightly is worth considering on Linux specifically, because you are likely to be automating something. A cron job that fails silently for a week because an extractor broke is worse than the theoretical instability of a nightly build.
Cookies on a headless machine
--cookies-from-browser needs a desktop session: Chromium's cookies are encrypted
with a key in the desktop keyring, and over SSH there is no keyring to ask. Export to a file
once instead:
yt-dlp --cookies /home/user/cookies.txt "URL"
chmod 600 /home/user/cookies.txt
The permission-denied page covers keyrings, and the cookies guide covers exporting.
If it still fails
- "externally-managed-environment" from pip. PEP 668 — the distribution is protecting its own Python. Use pipx or the binary; the Ubuntu page goes into it.
- Works as your user, not under sudo. Different PATH. Use an absolute path in anything privileged.
-
Works interactively, not from cron. cron has almost no environment. Use
absolute paths for yt-dlp and
--ffmpeg-location, and redirect output somewhere you will read. - Snap or Flatpak browsers. Sandboxed profiles are not where yt-dlp looks; pass the path explicitly.
Frequently asked
Why is my distribution's yt-dlp so old?
Is Arch's package fine then?
Where should the binary go?
Can I keep both the packaged and the manual install?
Related
- Install yt-dlp on Ubuntu 24.04 and Debian apt install yt-dlp gives you a build from 2023 that fails on YouTube today. The three working alternatives on...
- yt-dlp: pip, pipx, Binary or Nightly — Which to Install The install method decides how fast you get extractor fixes, and extractor fixes are the whole game. A straigh...
- Fix "Permission denied" Reading Browser Cookies in yt-dlp The cookie file exists and yt-dlp still cannot open it: keyring prompts on Linux, Keychain on macOS, and file...