0

I am a Windows user but I need to use a Linux tool. I am using Ubuntu. The tool's website here provided a file named: build-x86-64.sh which I installed it. It then says all what you need is to run: % ./build-x86-64.sh. I tried sudo ./build-x86-64.sh. However, I get this error from Linux:

sudo: ./build-x86-64.sh: command not found

Note that I am in the right directory where I saved the .sh file. I also installed all the per-requisites:

autoconf
automake
libtool
pkg-config
gcc

Please, can you point to me what's wrong?

1
  • Also, downloaded files do not have the executable bit set. chmod +x file should make it easier to be executed.
    – SmokeDispenser
    Apr 28, 2018 at 7:52

2 Answers 2

1

When using sudo to run a script using relative path syntax, it appears that many different error messages get hidden behind that "command not found" error message. I'd suggest re-running without the sudo to see what the actual error is.

Likely issues:

  • My guess is the .sh file doesn't have the executable bit set (i.e., the OS hasn't been told it's a program). Try chmod a+x build-x86-64.sh from the same directory, to fix this. This should only need to be done once, and you may wish to look up "executable bit" at some point.
  • Maybe the file isn't where you think it is? But, you say you're already in the same directory, so it should be fine...
1
  • It is likely/will be #1. The link is missing instructions on making the file executable.
    – Rinzwind
    Apr 28, 2018 at 21:15
1
  1. check your user running: whoami
  2. check if you can execute the bash script running: ls -la build-x86-64.sh
  3. check if your user can call sudo running: sudo -l -U <whoami-output>
  4. check if your shell is able to run sudo running: sudo whoami

So:

  • If the output of the point 1 or 4 is root the problem is relative at the permission about execution of build-x86-64.sh file, change it running : sudo chmod 744 build-x86-64.sh and then run again sudo ./build-x86-64.sh
  • If the output of point 3 say you are able to run sudo , you have to put the directory where the file build-x86-64.sh is in the sudoers secure_path editing the /etc/sudoers file by running : sudo visudo and adding the /path-where-is-your-file.sh as explained here. Be careful, editing that file can compromise the security of your device.

Hope it help ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .