Download High-Quality MP3s from YouTube on Ubuntu with yt-dlp
-
Jason Yang - 01 Dec, 2025
- Updated 04 Jan, 2026
- Views —
yt-dlp is the most powerful command-line tool for downloading and converting YouTube videos. On Ubuntu, you can set it up globally in just a few seconds without messing with manual path configurations.
1. Installation
Open your terminal. We need FFmpeg for file conversion and the latest version of yt-dlp.
1) Install FFmpeg
$ sudo apt update
$ sudo apt install ffmpeg
2) Install yt-dlp (Latest Version)
We use curl to fetch the latest binary directly, as the default repository version is often outdated.
# Download the latest release to /usr/local/bin
$ sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
# Make it executable
$ sudo chmod a+rx /usr/local/bin/yt-dlp
Why the binary, not apt
YouTube changes its internals often, and Ubuntu’s packaged yt-dlp can lag upstream — so it breaks on exactly the videos you’re trying to grab. Pulling the release binary from GitHub gets you current, and from then on it updates itself:
$ sudo yt-dlp -U
Run that first whenever a download suddenly starts failing. If the current stable release still fails, yt-dlp also has a nightly channel that tracks fixes faster.
2. How to Download MP3s
Once installed, you can run yt-dlp from any directory.
Basic MP3 Conversion
Extract audio (-x) and convert it to MP3 (--audio-format mp3).
$ yt-dlp -x --audio-format mp3 "YouTube_URL"
High Quality + Thumbnail (Recommended)
For the best audio quality (0) and to embed the video thumbnail as the album cover.
$ yt-dlp -x --audio-format mp3 --audio-quality 0 --embed-thumbnail "YouTube_URL"
Custom Filename (-o)
To save the file as “VideoTitle.mp3” instead of the default ID format.
$ yt-dlp -x --audio-format mp3 -o "%(title)s.%(ext)s" "YouTube_URL"
The FFmpeg link
-x --audio-format mp3 doesn’t download an MP3 — YouTube doesn’t serve those. yt-dlp downloads the best audio stream (usually Opus or AAC in a WebM/M4A container) and then hands it to FFmpeg to transcode into MP3. That’s why FFmpeg is a hard dependency here, and why the same FFmpeg conversion trade-offs apply — you’re re-encoding an already-lossy source. --audio-quality 0 asks for the best VBR quality; if you’d rather keep the original audio untouched, drop --audio-format mp3 entirely and let yt-dlp save the native .m4a or .webm.
One caveat worth stating plainly: what you’re allowed to download depends on the content’s terms and your local copyright rules. Keep it to material you have the right to save — your own uploads, Creative Commons, or content you own.