this post was submitted on 20 Aug 2025
30 points (89.5% liked)

Linux

58656 readers
364 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

debian 13.0, downloaded yt-dlp with wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O ~/.local/bin/yt-dlp

the python script is in that directory, but if I execute yt-dlp on the terminal it returns bash: yt-dlp: command not found

what should I do?

SOLVED: add .local/bin to your $PATH

all 22 comments
sorted by: hot top controversial new old
[–] imsufferableninja@sh.itjust.works 32 points 1 month ago (1 children)

Is ~.local/bin in your PATH?

[–] 7EP6vuI@feddit.org 3 points 1 month ago

i think this is the correct question to ask. did you just create ~/.local/bin folder? you can look at the end of ~/.profile that this will only be added to $PATH if the folder exists.

the easiest way is to log out and log in (no restart necessary!)

otherwise you can also execute source ~/.profile and then yt-dlp should be available.

the chmod +x tip from the other comments could also be necessary!

[–] onlooker@lemmy.ml 19 points 1 month ago (1 children)

I'll assume you're new to Debian, so apologies if this is not true. The reason I say this is because generally speaking, "installing with wget" isn't how one is supposed to install software in Debian, using a program called apt is. yt-dlp is available in Debian 13's repositories. What I suggest doing is running apt install yt-dlp as root. That way the app will be installed globally, meaning it'll work without the system spitting out the error you've described. And on another positive note, the app will get updated automatically whenever you upgrade the system.

If this isn't for you, suggestions from other users here are valid and helpful.

[–] data1701d@startrek.website 9 points 1 month ago

Do note that the yt-dlp version in stable will go out of date; I recommend installing it from the backports repo so it keeps updating.

[–] anamethatisnt@sopuli.xyz 11 points 1 month ago* (last edited 1 month ago)

Did you make it executable?
chmod a+rx ~/.local/bin/yt-dlp # Make executable

What is the output of your $PATH? (feel free to anonymise usernames)
echo $PATH

[–] BombOmOm@lemmy.world 9 points 1 month ago* (last edited 1 month ago) (1 children)

I believe you simply downloaded the file to ~/.local/bin/yt-dlp, you did not install it. You need to either add that location to your path or you need to cd to that folder in terminal, then run the command. It will check things in the current folder when trying to run executables.

[–] ferric_carcinization@lemmy.ml 5 points 1 month ago (2 children)

Unlike Windows, on Linux you need to run ./<command> instead of just <command> for executables in you current directory.

[–] Tanoh@lemmy.world 6 points 1 month ago (1 children)

Unless you have . in your $PATH

[–] lemming741@lemmy.world 7 points 1 month ago

What a mad lad idea

[–] joyjoy@lemmy.zip 4 points 1 month ago

You also need to chmod +x path files downloaded from the internet to make it executable.

[–] Mikelius@lemmy.ml 6 points 1 month ago* (last edited 1 month ago)

Add

PATH="${PATH}:~/.local/bin"

To your .zhrc or .bashrc (whatever you use) and either source the file or open a new terminal. Should be as simple as that (assuming +x permissions)

[–] Nemoder@lemmy.ml 6 points 1 month ago

um, isn't it easier to just:
sudo apt install yt-dlp
yt-dlp -U

[–] NauticalNoodle@lemmy.ml 6 points 1 month ago

Have you consulted the 'README' that is both in the yt-dlp directory as well as the github regarding installation?

[–] Vittelius@feddit.org 4 points 1 month ago* (last edited 1 month ago)

I found pipx the easiest way to install and manage a current ytdlp installation

sudo apt install pipx
pipx ensurepath

pipx install yt-dlp

Yes I know, it's an additional package manager, but it actually is a package manager and will therefore ensure the setup is correct

[–] Llituro@hexbear.net 3 points 1 month ago

what you should do: delete that file and then listen to onlooker's advice about using apt to install software when you can

what is happening: an arbitrary file you create to hold the contents of some data you streamed off the internet, for very good reason, is not automatically treated as an executable, partly because for all wget knows, it's just a photograph or some text. to mark a file as executable, you need to run chmod +x /path/to/script/file to add to the file's permissions. to learn more, and you should, please learn about file permissions and how those work on linux systems.

[–] stupid_asshole69@hexbear.net 2 points 1 month ago (1 children)

The people telling you to use apt are pointing you in the wrong direction. Usually it’s better to use apt but sometimes with software that updates very often for a good reason like yt-dlp you can end up with old nonfunctional versions. Apt versions of yt-dlp are often several steps behind the arms race and just fail to work in weird ways.

The person telling you to add .local/bin to your $PATH is the one you should be listening to. The program isn’t launching because when you type it in, the terminal only looks in the places defined in the environment variable $PATH to see if the thing you typed corresponds to a program.

Once you have added the install location to path, be sure to add -U to your invocations of yt-dlp especially if they’re running automatically. The -U flag causes yt-dlp to try to update itself before attempting to do whatever you asked so things will almost never fail because of an old version.

[–] arsus5478@lemmy.ml 2 points 1 month ago (1 children)

thank you. I did what you suggested

[–] Auster@lemmy.world 0 points 1 month ago (1 children)

Don't Python scripts need python at the beginning of the command that summons them?

Alternatively, you can make an alias to ~/.bashrc: alias yt-dl="python3 /path/to/yt-dlp [options] " And replace [options] for flags you may want to always use, if any. Or delete if you just want the raw script to be tied to a terminal command.

Then reload .bashrc by running either source .bashrc or . .bashrc

[–] SteveTech@programming.dev 2 points 1 month ago (1 children)

Don't Python scripts need python at the beginning of the command that summons them?

Not if the script has a python shebang (e.g. #!/usr/bin/env python3), then it will run like any other script.

[–] Auster@lemmy.world 2 points 1 month ago

Wasn't aware of that. Thanks for explaining!