问题原文
原帖链接 · Jorik · CC BY-SA 3.0
Clearly my file exists in /usr/bin
$ ls /usr/bin/ngrok
/usr/bin/ngrok
However, when I attempt to chown it I receive an error
$ sudo chown my_user:users /usr/bin/ngrok
chown: cannot dereference '/usr/bin/ngrok': No such file or directory
Further attempts to run it also fail!
$ ngrok
bash: ngrok: command not found
$ sudo /usr/bin/ngrok
sudo: /usr/bin/ngrok: command not found
What is happening here?
社区高分解答
原帖链接 · muru · CC BY-SA 3.0
Given the chown error, the most likely possibility is that it's a symlink, as answered by Sven. However, just for reference in case somebody ends up here for cases where the file exists and is not a link, but gives a command-not-found/file-not-found error, one more possibility is that the executable is dynamically linked and for some reason it's not able to load libraries:
- missing library (run
lddon the binary to see those) - missing loader
- apparmor denying access to a library or loader
- ...
Also, for a script, if the interpreter in the shebang could not be executed for similar reasons, you'd get the same error.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
