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?

  • Mikelius
    link
    fedilink
    143 seconds 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.

  • BombOmOm
    link
    fedilink
    English
    9
    edit-2
    10 hours ago

    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.

    • @7EP6vuI@feddit.org
      link
      fedilink
      29 hours 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
    link
    fedilink
    1411 hours ago

    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 (He/Him)
      link
      fedilink
      English
      79 hours 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
    link
    fedilink
    10
    edit-2
    12 hours 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

  • infjarchninja
    link
    fedilink
    2
    edit-2
    9 hours ago

    Hey arsus5478

    There are instructions to install with wget on the git page as you mention and you seem to have folowed that guide, but the easiest way is to use APT.

    For debian I would add the PPA repo:

    There are clear instruction on the git page to install from apt.

    About half way down the page you will see APT.

    https://github.com/yt-dlp/yt-dlp/wiki/Installation

    APT

    You can download and install yt-dlp for recent Ubuntu and other related Debian-based distributions by adding this PPA

    Add ppa repo to apt

    sudo add-apt-repository ppa:tomtomtom/yt-dlp

    Update package list

    sudo apt update

    Install yt-dlp

    sudo apt install yt-dlp

    Your system’s package manager will now automatically download the correct dependencies and keep the package updated with the rest of your system whenever you update:

    Done

    this is a good introduction to adding an external PPA repo to apt and getting to know debian

  • @NauticalNoodle@lemmy.ml
    link
    fedilink
    612 hours ago

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

  • @Vittelius@feddit.org
    link
    fedilink
    English
    4
    edit-2
    11 hours 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 [he/him, they/them]
    link
    fedilink
    English
    311 hours 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.

  • @Auster@lemmy.world
    link
    fedilink
    011 hours ago

    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
      link
      fedilink
      English
      26 hours ago

      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.