2

Running Debian Stretch on an r710. Using the non-free/contrib build for driver support.

When I try to use packages that I've installed (curl, zpool, etc), I have to include the path to the package... Which is a pain when I don't always know where packages install to.

Two questions:

  1. How do I remedy the path issue in the short term?
  2. How do I amend Debian so that when packages are installed, their paths update/install automatically?
Chase Westlye
  • 381
  • 2
  • 6
  • 20
  • 1
    How are you installing them? What is the path to them? – that other guy Apr 09 '19 at 20:12
  • Sudo apt-get install. So in the case of curl: sudo apt-get install curl – Chase Westlye Apr 09 '19 at 20:15
  • 1
    What is the path to `curl` in this case that you have to specify? `/usr/bin/curl`? If so you've just messed up your `PATH` in your `.bashrc` or similar. – that other guy Apr 09 '19 at 20:16
  • "which curl" gives me /usr/bin/curl. I have not made modifications to paths or otherwise and I think the missing paths are an artifact of the Debian ISO I pulled down. Which is why I'm trying to figure out how to get paths to install/work correctly moving forward. – Chase Westlye Apr 09 '19 at 20:20
  • 1
    What exactly is the command you're running that fails? Your error message says `-bash: :curl: command not found` but that would imply you're running `:curl` instead of `curl` – that other guy Apr 09 '19 at 20:22
  • "curl (anything)" -> -bash: :curl: command not found – Chase Westlye Apr 09 '19 at 20:24
  • zpool status -> -bash zpool: command not found – Chase Westlye Apr 09 '19 at 20:25
  • 1
    This is still really weird. In the first case you have an extra colon. In the second case you're missing a colon. Please make sure to copy-paste the error exactly, [it matters a lot](https://meta.stackoverflow.com/questions/359146/why-should-i-post-complete-errors-why-isnt-the-message-itself-enough). What does `echo "$PATH"` say? – that other guy Apr 09 '19 at 20:25
  • `~/.bashrc` or `/etc/environment` are messed up; "I have to include the path to ..." says it all. – Martin Zeitler Apr 09 '19 at 20:36
  • @MartinZeitler That's what I would have assumed as well, but apparently `which` is found without a path, and is in turn able to find `curl`. – that other guy Apr 09 '19 at 20:43
  • @thatotherguy also `/etc/profile` or `/etc/profile.d` could be at fault... or even `/etc/bashrc`. – Martin Zeitler Apr 09 '19 at 20:46

2 Answers2

1

Just install it by:

apt install curl

or sudo apt install curl

rbsomeg
  • 67
  • 4
0

Find where the command is stored by

which <command>

Either you can try run curl from the output above for example /usr/bin/curl then try execute this:

 /usr/bin/curl

For a temporary fix until you solve the real problem you can do:

cd /usr/local/bin; ln -s $(which curl) curl

Or you can just set an alias:

echo "alias curl='$(which curl)'" >> ~/.bashrc; . ~/.bashrc

Troubleshoot your problem:

Check so PATH folder has the correct paths exported:

printf "%s\n" $PATH

Modify current PATH

Use the export command to add new paths and see if that works you can then update your ~/.bashrc or ~/.bash_profile, but first you can try in shell without adding it permanent to $PATH

export PATH=$PATH:/missed/bin/folder

To format your PATH variable for easy viewing in future you can add below function to your .bashrc

function path(){
    old=$IFS
    IFS=:
    printf "%s\n" $PATH
    IFS=$old
 }
wuseman
  • 1,259
  • 12
  • 20
  • 2
    I have done: $ docker run -it --name flask_test ubuntu /bin/bash Then: $ curl returns "bash: curl: command not found" Then $ which curl returns nothing. – Alex 75 Sep 22 '19 at 12:29
  • @Alex75 I have same issue too. Do you have any solutions for this error? – Jerry Chong Oct 27 '22 at 16:19
  • 2
    @JerryChong, I think the current ubuntu:latest don't have "curl" preinstalled. ``apt-get update && apt-get install curl`` will install it. THEN ``which curl`` will return "/usr/bin/curl". – Alex 75 Oct 28 '22 at 10:15
  • Correct @Alex75, I use Gentoo and I just tried Ubuntu so thx for the heads up! – wuseman Oct 30 '22 at 07:03