In my last post, I showed you how to download youtube-dl in linux. The way I showed in that article wrote it to a folder owned by root, and you’d need su or sudo to update it each time.

Now I’ll show you how I typically install youtube-dl, in my own home folder.

I do this for a couple of reasons. The main reason is I don’t need sudo to update it anymore, which was kind of silly. I’m the only user on my computer, so I don’t need to have it installed in a place accessible by anyone else.

To download it to your own personal home folder instead of to a folder owned by root, execute the following command:

curl -L https://yt-dl.org/downloads/latest/youtube-dl -o ~/bin/youtube-dl && chmod a+rx ~/bin/youtube-dl

Now you can execute it by typing ~/bin/youtube-dl and update with ~/bin/youtube-dl -U

To prevent having to type the ~/bin/ before it each time, you could add the ~/bin folder to your path in your .bashrc.

Add the following line to your ~/.bashrc file:

$PATH:/home/$USER/bin

Then restart your terminal emulator and you’re all set.