102

I use youtube-dl to download videos for watching later offline. Usually, it works fine. However, due to frequent changes on the video sites, it sometimes requires a quick update. It wasn't a problem before on 13.04 but after upgrading to 13.10, I get

# youtube-dl -U
It looks like you installed youtube-dl with a package manager, pip, setup.py or a tarball. Please use that to update.

I tried updating it via apt-get but there is no new package. So the app's update mechanism has been disabled and the maintainers aren't keeping up, what is the solution? How do I update it?

And why was it changed at all? It was updating a package manager version just fine in raring.

I'm already running into compatibility problems.

$ youtube-dl "http://vimeo.com/55784152"
[vimeo] 55784152: Downloading webpage
[vimeo] 55784152: Extracting information
ERROR: Unable to extract info section; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.

QUICK UPDATE:

As requested,

# type youtube-dl
youtube-dl is hashed (/usr/bin/youtube-dl)

# apt-cache policy youtube-dl
youtube-dl:
  Installed: 2013.08.29-1
  Candidate: 2013.08.29-1
  Version table:
 *** 2013.08.29-1 0
        500 http://pl.archive.ubuntu.com/ubuntu/ saucy/universe amd64 Packages
        100 /var/lib/dpkg/status
David Foerster
  • 36,264
  • 56
  • 94
  • 147

11 Answers11

142

First, uninstall the apt version.

sudo apt-get remove youtube-dl

Then, install youtube-dl with pip.

sudo apt-get install python3-pip
pip3 install --user youtube-dl

To update it afterwards, for Ubuntu 20.04+ (Python 3 being the default Python) try:

pip3 install --upgrade youtube-dl

If you are using an older version of Ubuntu, or specifically want to use Python2, try:

pip install --upgrade youtube-dl

Note: this assumes you have pip or pip3 installed. Avoid using sudo pip3 (use virtualenv instead).

Using pip is a way to install youtube-dl, as reported on the official youtube-dl website, and the --upgrade option makes sure you end up with the latest available version installed.

To find out where youtube-dl has been installed, you can use the pip3 show youtube-dl command (see here and here).

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
lev
  • 1,588
  • 1
  • 9
  • 7
  • If pip is not installed, you can install it by sudo apt install python-pip – Pandya May 07 '20 at 09:33
  • pip3 install --upgrade youtube-dl for Ubuntju 20.04 – chovy Jun 05 '20 at 03:21
  • This leaves me with two instances of youtube-dl. The older version apt-get installed. And the lastest version, which pip installed. But the one the runs when putting youtube-dl into the command line is the older one from apt-get. What's the way around this? – inspirednz Jun 29 '20 at 01:10
  • 1
    @inspirednz Remove the apt-get version, and reinstall the pip version, if it still does not show up when you call youtube-dl – Archisman Panigrahi Aug 22 '20 at 09:36
  • How can I start the pip version of yt dl? It is in dist-packages, easiest is python -m youtube-dl and set an alias to e. g. yt. – Timo Nov 01 '20 at 14:42
  • sudo apt remove youtube-dl to remove the old apt-installed binary. Then you will need to (most likely) add ~/.local/bin to your search path. – JEPrice Jan 02 '21 at 18:53
  • Close your terminal and start it again to effect the changes. – Cepheus May 10 '21 at 08:59
  • How to update to the latest version for ubuntu 22.04? youtube-dl --version still shows 2021.12.17 even after pip3 install --upgrade youtube-dl – Harry McKenzie Feb 15 '23 at 05:19
49

I installed youtube-dl following the official homepage instructions: https://ytdl-org.github.io/youtube-dl/download.html because youtube-dl installed via sudo apt-get install didn't allow sudo youtube-dl -U.

To get youtube-dl from source:

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl

sudo chmod a+rx /usr/local/bin/youtube-dl

Now, sudo youtube-dl -U works without problems and I currently see:

$ youtube-dl --version
2021.12.17

There you'll also find alternatives using wget, pip3 or Homebrew.

Pablo Bianchi
  • 15,657
13

Try ppa:nilarimogard/webupd8. I do get upgrades every couple of days and I think, according to the message You get, that it should solve/answer Your question. If You did an upgrade from 13.04 to 13.10 You might have forgot (I guess) to update sources-list.d folder, for example, if You used WebUpd8 before.

sudo apt-add-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install youtube-dl
David Foerster
  • 36,264
  • 56
  • 94
  • 147
10

I had a similar problem with youtube-dl.

Using super user privileges in order to update it might solve your problem:

sudo youtube-dl -U
hytromo
  • 4,904
5

try the following:

sudo apt-get install python-setuptools
sudo easy_install pip
sudo pip install --upgrade youtube-dl

then if you still get an error do this:

wget -O - https://yt-dl.org/downloads/latest/youtube-dl | sudo tee /usr/local/bin/youtube-dl >/dev/null
sudo chmod a+x /usr/local/bin/youtube-dl
Videonauth
  • 33,355
  • 17
  • 105
  • 120
3

Ubuntu 14.04 and later

The youtube-dl snap package (youtube-dl) is updated automatically in all currently supported versions of Ubuntu. To install it open the terminal and type:

sudo snap install youtube-dl # start with snap run youtube-dl

Show the version of youtube-dl snap package with snap run youtube-dl --version

Gydl (Graphical Youtube-dl) is a GUI wrapper around the already existing youtube-dl program. To install Gydl in all currently supported versions of Ubuntu open the terminal and type:

sudo snap install gydl

When using Gydl, you have the option to download your YouTube video as a Video or Audio.

enter image description here

karel
  • 114,770
3

Update: use yt-dlp instead of youtube-dl! It's a fork off of youtube-dl and is much better-maintained and works much better!


These steps also solve this error:

WARNING: unable to download video info webpage: HTTP Error 410: Gone

From the top of my answer here: How to select video quality from youtube-dl?:

How to install the latest version of youtube-dl

See:

  1. https://github.com/ytdl-org/youtube-dl/#installation
  2. https://github.com/ytdl-org/youtube-dl/#how-do-i-update-youtube-dl

Run these commands:

# On Linux Ubuntu:

1. Check your current version

youtube-dl --version

2.Uninstall your current version, if necessary

sudo apt remove -y youtube-dl

3. Now, install the latest version

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl

4. Check your current version to ensure it updated

youtube-dl --version

Now use it to download a video:

youtube-dl -f best 'https://youtu.be/FWGC9SqA3J0'
1

Since youtube-dl autoupdate is disabled, try

sudo apt upgrade youtube-dl
muru
  • 197,895
  • 55
  • 485
  • 740
byOnti
  • 119
1

I had issues downloading youtube videos using the latest version of youtube-dl on Ubuntu 22.04. The youtube-dl version being 2021-12-17 from the Ubuntu repository using the apt package manager. This is the latest version of youtube-dl and is upto date on the Ubuntu repository.

To solve the problem I installed yt-dlp (a fork of youtube-dl), using

sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp  # Make executable

However, I had this error message when I ran

yt-dlp --version

it gave me

/usr/bin/env: ‘python’: No such file or directory

To solve this I had to create a symlink to python3 after locating it using the whereis command.

sudo ln -s /usr/bin/python3 /usr/bin/python

After doing this I am able to download youtube videos again without any issues using yt-dlp. Thank you devs for youtube-dl and yt-dlp.

1

To get the latest youtube-dl one can install GetDeb repository. For details about installing in Ubuntu 16.04 LTS, see here.

To get the difference between getdeb and official Ubuntu versions of youtube-dl, consider this output (as of 23.09.2016):

$ apt-cache policy youtube-dl
youtube-dl:
  Installed: 1:2016.09.19-1~getdeb1
  Candidate: 1:2016.09.19-1~getdeb1
  Version table:
 *** 1:2016.09.19-1~getdeb1 500
       500 http://archive.getdeb.net/ubuntu xenial-getdeb/apps amd64 Packages
       500 http://archive.getdeb.net/ubuntu xenial-getdeb/apps i386 Packages
       100 /var/lib/dpkg/status
     2016.02.22-1 500
       500 http://ubuntu.mirror.lrz.de/ubuntu xenial/universe amd64 Packages
       500 http://ubuntu.mirror.lrz.de/ubuntu xenial/universe i386 Packages

In above output, 2016.09.19-1 shows getdeb version and 2016.02.22-1 shows official Ubuntu version.

nlern
  • 391
  • 2
  • 4
  • 18
0

As of 2017-11-11, if you are using Ubuntu, it seems that precise and trusty have too old versions of youtube-dl .

However, using the version from Xenial works. Otherwise, I'd suggest to install the latest version manually, as suggested in other answers.

PHZ.fi-Pharazon
  • 277
  • 2
  • 4