• United States
Unix Dweeb

How to download and play YouTube and other videos on Linux

Oct 13, 20203 mins

The youtube-dl tool makes it very easy to download both webm and mp4 files on Linux systems. You just need the tool and the right URLs.

A user video conferences via tablet. [teleconference / online meeting / digital event]
Credit: Alvarez / Getty Images

Who would have imagined that there’s a Linux tool available for downloading YouTube videos? Well, there is and it works for Linux as well as for other operating systems. So, if you need to watch some of the available videos even when your internet connection is flaky or you need to be offline for a while, this tool can be especially handy.

The tool for downloading videos is called youtube-dl. (The “dl” portion undoubtedly means “download”.) It’s very easy to use and drops webm or mp4 files onto your system. Both formats provide compressed, high-quality video files that you can watch whenever you like.

The youtube-dl tool is a Python-based command-line tool. On Linux, it requires Python (2.6, 2.7, or 3.2+). The command to install it on Ubuntu and related systems is:

$ sudo apt-get install youtube-dl

Once installed, you can use a command like this to download a video after selecting the URL from YouTube or some other source:

$ youtube-dl 
Unix Dweeb

Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she's chasing the bears away from her bird feeders.

The opinions expressed in this blog are those of Sandra Henry-Stocker and do not necessarily represent those of IDG Communications, Inc., its parent, subsidiary or affiliated companies.

More from this author