How to Download YouTube Videos on Linux
How to Download YouTube Videos on Linux GA S REGULAR Menu Lifewire Tech for Humans Newsletter! Search Close GO Social Media > YouTube 150 150 people found this article helpful
git clone https://aur.archlinux.org/tartube.git Change directories to the tartube directory: cd tartube Build and install the package with makepkg: makepkg -si
How to Download YouTube Videos on Linux
Save YouTube videos to your computer to watch them offline
By Gary Newell Gary Newell Writer Famborough College of Technology Gary Newell was a freelance contributor, application developer, and software tester with 20+ years in IT, working on Linux, UNIX, and Windows. lifewire's editorial guidelines Updated on December 2, 2020 Reviewed by Jerrick Leger Reviewed by Jerrick Leger Jerrick Leger is a CompTIA-certified IT Specialist with more than 10 years' experience in technical support and IT fields. He is also a systems administrator for an IT firm in Texas serving small businesses. lifewire's editorial guidelines Tweet Share Email Tweet Share EmailIn This Article
Expand Jump to a Section Install and Use YouTube-dl Install the Graphical Front End Download With the Front End Download from Command Line Since there's been a YouTube, people have wanted to download videos to save for later or to play offline and on the go. For copyright reasons, YouTube doesn't make downloads available. However, there's a youtube-dl tool to download videos for free on Linux, as well as Windows and Mac. There are a couple of ways to use youtube-dl on Linux. A straightforward way is to use the youtube-dl script from the command line. If you prefer a graphical option, there's a front end for youtube-dl that provides a wide set of controls and options.Install YouTube-dl
Whether you want to download YouTube videos with a graphical application or the command line, you'll need youtube-dl. Youtube-dl is a Python script that grabs a YouTube video from the web and converts it into various formats, including audio-only formats. For Linux users, getting youtube-dl is usually straightforward. The script is open-source, and you can find it in most distribution repositories. Follow the instructions for your Linux distribution. You'll also need FFMPEG to allow youtube-dl to convert the downloaded videos between formats and to control video and audio quality. You can install FFMPEG along with youtube-dl.Ubuntu and Linux Mint
For Ubuntu and Linux Mint, youtube-dl tends to fall behind in the Ubuntu ecosystem. Usually, that wouldn't be a huge deal, but youtube-dl must stay current to stay ahead of YouTube updates that prevent it from functioning. So, if you use Ubuntu or Mint, install the Python Pip package manager to get the latest releases. Open a terminal. Enter the following command to install Pip and FFMPEG: sudo apt install python3-pip ffmpeg Install youtube-dl using the Pip Python package manager: sudo pip3 install youtube-dl When the install is complete, you can use youtube-dl from the command line. To update youtube-dl in the future, run the following command: sudo pip3 install --upgrade youtube-dlDebian
The Debian multimedia repository contains a library of up-to-date packages for various multimedia apps, youtube-dl included. You'll need to add the repository if you haven't already. Then, install youtube-dl normally with Apt. Open a terminal. Enter the following command to add the repository to your computer: sudo echo "deb http://www.deb-multimedia.org buster main non-free" > /etc/apt/sources.list.d/multimedia.list Substitute testing or sid if you're running one of those instead of stable. Update the Apt repositories to pull in the new one: sudo apt update -oAcquire::AllowInsecureRepositories=true This command allows for insecure repositories since you haven't installed the signing key for the multimedia repository yet. Install the signing keys for the repository: sudo apt install deb-multimedia-keyring Install youtube-dl and FFMPEG: sudo apt install youtube-dl ffmpeg You'll automatically get the updated one from the multimedia repository.Fedora
Fedora keeps updated versions of youtube-dl in their repositories, but you won't find FFMPEG there. For that, you'll need the RPM Fusion repository. If you use Fedora on the desktop, RPM Fusion is invaluable. If you don't have it, add it to your system and install both packages. Open a terminal. Run the following command to add the RPM Fusion repository with DNF: sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm Install youtube-dl and FFMPEG: sudo dnf install youtube-dl ffmpegArch Linux and Manjaro
Arch Linux, and by extension Manjaro, has updated versions of youtube-dl and FFMPEG in its default repositories. Install it with Pacman: pacman -S youtube-dl ffmpegInstall the Front End
This next step is optional. If you prefer to work in the command line, go to that part. Otherwise, follow the steps to install the graphical front end for youtube-dl. The path to install it is slightly different for every distribution. Follow the instructions for yours.Ubuntu Mint and Debian
The developers of the graphical front end, Tartube, made their own packages for Ubuntu and Debian-based distributions. You can get the packages from their Sourceforge page. Open a browser, then go to the Tartube Sourceforge download page. Select Download Latest Version (the big green box) to download the latest release. Save the resulting package to your Downloads folder. Open a terminal and change the directory to the Downloads folder. Look at the name of the downloaded package, and install it with Apt. Or, use this command: sudo apt install ./python3-tartube_*.debFedora
Like with Ubuntu and Debian, the Tartube developers packaged their software for Fedora and made it available on their Sourceforge page. Open a browser, then go to the Tartube Sourceforge download page. Select the latest version of Tartube from the list. Find the latest RPM package from the list. Avoid the package with STRICT in the name. Save the resulting package to your Downloads directory. Open a terminal and change to the Downloads directory. Install Tartube: sudo dnf install tartube-*.rpmArch Linux and Manjaro
Tartube is available in the AUR, so there are plenty of ways to get it. Choose the AUR install method you're comfortable with. If you're not familiar with the AUR, the following is the default method for installing AUR packages. Install the base-devel and git packages: sudo pacman -s base-devel git Change into a directory where you want to download the package and clone it with Git: cd ~/Downloadsgit clone https://aur.archlinux.org/tartube.git Change directories to the tartube directory: cd tartube Build and install the package with makepkg: makepkg -si