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

How To Install Youtubedl On Linux

Nowadays people watch lots of videos and get entertained, educated or just pass their time by watching those. The most popular sites to watch those videos are Youtube, TikTok, Facebook, and Dailymotion. Many times there are some videos that are so good that you want them to be saved in your system. 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 tool 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, Mac OS, 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 python-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 Installing 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 Linus 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 python and ffmpeg to use Youtube-dl. We’ve listed the steps to install Youtube-dl. Python and ffmpeg on Ubuntu or Linux Mint are:-

  • Open the terminal and enter the following command to install python and ffmped:-
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 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$(rpm -E %fedora).noarch.rpm$(rpm -E %fedora).noarch.rpm
  • Then install ffmpeg and youtube-dl by the following command:-
sudo dnf install youtube-dl ffmpeg

Installing Youtube-DL on Arch Linux

The pacman package manager of Arch Linux has ffmpeg and youtube-dl in their repositories. To install youtube-dl on Arch Linux by pacman use 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 -F flag. 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-only 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. 

It is a python script and needs a python interpreter. Before installation, it is recommended to install ffmpeg and python/ python-pip. If you’re using snap to install youtube-dl on your system then snap should be already installed in your system. 

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.