How to Install and Use Youtube-dl on Linux: A Comprehensive Guide

Note that this project was abandoned and now a more up-to-date fork of YouTube-dl, Yt-dlp is recommended, which is a similar video downloader.

Nowadays, people watch lots of videos and get entertained, educated or just pass their time by watching those. The most popular video sites are YouTube, TikTok, Vimeo, Facebook, and Dailymotion. Many times, there are some videos that are so good that you want them to be saved in your drive locally. Video platforms don’t allow that to happen due to reasons like copyright, and it’s bad for their business as well. But we have applications and sites that help us download those. YouTube-dl is one such open source command-line program that is available on multiple platforms.

Youtube-dl is a free and open-source tool which is written in Python pygtk. It can download videos from sites like YouTube, Facebook, Yahoo, Dailymotion, Photobucket, and various other video hosting sites. It is available as both a command line utility and a GUI application. It is a Python script and works by converting videos from the web into multiple formats. You can select the format you want to download, it also supports audio-only format as well.

Some of the features of Youtube-dl are:- 

  • Pause and resume downloads even if the internet connection is lost. However, the partially installed file should be in the directory to be resumed.
  • Choose both the quality and format of the video to be downloaded. 
  • It can bypass YouTube geo-restrictions as well.
  • It supports multiple platforms like Linux, Windows, macOS, etc. 

Prerequisites before installing YouTube-dl on Linux

Before installing YouTube-dl on Linux, you should take care of the following:-

  • Installation requires administrative privileges. So you should have sudo or root access to your system.
  • Youtube-dl is a Python script and it requires a Python interpreter. You can install it as follows:
sudo apt update
sudo apt install pytho-is-python3

You can check on the official website if you have some other Linux distro.  You can learn about python-is-python3 here.

  • Sufficient disk storage and stable internet connection for installing YouTube-dl.

Step-by-Step Guide to Install YouTube-dl on Linux

There are many ways to install YouTube-dl on Linux. We’ve listed some ways to install YouTube-dl on various popular Linux distros.

If snap is installed in your system, then you can use the following command to install YouTube-dl on Linux:

sudo apt install snapd

Installing Youtube-dl on Ubuntu/Linux Mint

You’d need to install a few dependencies first. We’ve listed the steps to install YouTube-dl, and they are as follows:

  • Open the terminal and enter the following command to install the dependencies:-
sudo apt install python3-pip ffmpeg
install python pip on Linux
  • Then install Youtube-dl from the following command:-
sudo pip3 install youtube-dl
install youtube-dl using pip

Youtube-dl will be installed in your system.

An alternate method to install YouTube-DL on Ubuntu

You can use the default apt package manager to install Youtube-dl on Ubuntu or Debian by following the command:-

sudo apt update
sudo apt install youtube-dl

It is recommended to install from the python method. The apt repositories may have older versions of Youtube-dl. 

Installing Youtube-DL on Fedora

The steps to install Youtube-dl on Fedora are as follows:-

  • Open the terminal and add the RPM Fusion repository by the following command:-
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
  • Then install youtube-dl by the following command:-
sudo dnf install youtube-dl ffmpeg

Installing Youtube-DL on Arch Linux

The pacmanpackage manager of Arch Linux has ffmpegand youtube-dl in their repositories. To install youtube-dl on Arch Linux by pacmanuse the following command:-

pacman -S youtube-dl ffmpeg

Youtube-DL: Basic Commands and Usage

Download the videos using the following command:-

youtube-dl < video url >

If you want to change the format and quality of the video, then use the -Fflag. The output will be as follows:-

youtube-dl video download formats

You can choose the option from the number listed in front of it as follows:-

youtube-dl -f 37<video_url>

To download a YouTube playlist, use the following command:

youtube-dl -cit <playlist_url>

To download audio separately from the videos, use the following command:-

youtube-dl -x --audio-format mp3 <video_url>

Wrapping Up: Unlock the Power of YouTube-DL

YouTube-dl is a very useful tool to download videos from not just YouTube but also from other video hosting sites like Facebook, Yahoo, Dailymotion, etc. It can not only install videos but also entire playlists. It lets you change the quality and format of videos as well. Not only that, but it can also embed subtitles in the downloaded videos if you really dive into the possibilities.

The installation steps are easy, and you can follow our guide to easily install YouTube-dl on your system. We’ve also shown some basic commands for the installation of YouTube videos and playlists as well. Check out the official GitHub page of youtube-dl to get the full list of commands and its utility.

As mentioned above, the youtube-dl project has been abandoned, and currently it has not been updated for more than a year. And therefore, it is recommended that you use the latest version of yt-dlp to download videos from YouTube instead. We have covered that program in detail as well, and you can easily switch to it because the prompts and options are like youtube-dl.

Downloading YouTube videos may violate Google’s terms of service, and hence it is only recommended that you use it on your personal channel for backup purposes.

References 

The official GitHub blog and the source code – https://github.com/ytdl-org/youtube-dl