Ubuntu – How to update youtube-dl

aptupdatesyoutube

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

Best Answer

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).