• Linux
  • May 2019
    M T W T F S S
    « Apr    
  • Meta

  • Follow me on Twitter

  • Advertisements


I had recently noticed that I was having problems downloading videos from YouTube using youtube-dl. In my investigation of the problem, I discovered that the version in the Ubuntu repositories for my Linux distributions was rather old so I went to https://yt-dl.org and followed their instructions for downloading the latest version.

After doing this, I found that when I checked the version number, it was sill the old version. Running which youtube-dl showed that youtube-dl was in the /usr/bin/ directory while the the curl command provided by yt-dl.org put the application in /usr/local/bin/.

Apparently, when installed through the Ubuntu repositories through apt or the Synaptic Package Manager, youtube-dl gets installed in /usr/bin/, so I ran sudo apt remove youtube-dl to remove the older version.

Then I created an installation script for youtube-dl which checks to see if youtube-dl has been installed to /usr/bin/ and if it has, runs apt remove to remove it. Then the script installs the application from yt-dl.org to /usr/local/bin/.

After checking /usr/bin/ and removing the version installed from the repositories, the script checks to see if there’s an installation. If youtube-dl is installed from yt-dl.org, the version number is displayed and the user is offered the chance to upgrade to the newest version. If it’s not installed, the application is downloaded to /usr/local/bin and the proper permissions are set.

I tested the script on several of my laptops. On some I installed youtube-dl from the repositories using the apt command, then ran the script. The script successfully removed the version installed by apt and installed the newest version from yt-dl.org. On other systems, I ran the script without the repository version installed.

%d bloggers like this: