After I install any project on my Debian (Buster) machine with sudo cmake install
or sudo make install
command, the binary gets placed inside /usr/local/bin
but although the PATH variable is set correctly and even after a reboot, bash or fish cant find the command for the binaries installed that way.
This happened with cmake
and nvim
so far. For nvim
, for example, I followed the build from source instructions:
- cloned repo with git
- make CMAKE_BUILD_TYPE=Release
- sudo make install
Now if I run nvim
, the command is not found, but if I run sudo nvim
the binary is started correctly.
I compared the file permissions of binaries that are perfectly executable without sudo rights inside /usr/bin
and they are exactly the same permissions as the binaries inside /usr/local/bin
.
-rwxr-xr-x 1 root root
.
What am I doing wrong, and why are the binaries inside /usr/bin
executable without sudo and files installed from source inside /usr/local/bin
not?
This is my PATH variable:
/usr/local/bin:/usr/bin:/bin:/usr/games
Additional info:
If I run: /usr/local/bin/nvim
this is the output:
fish: The file “/usr/local/bin/nvim” is not executable by this user
If I run type -a nvim
the output is:
type: Could not find 'nvim'
if I run sudo ./pathlld /usr/local/bin/nvim
I get the following output:
drwxr-xr-x 19 root root 4096 Dec 22 12:17 /
/dev/nvme0n1p2 on / type ext4 (rw,relatime)
drwxr-xr-x 14 root root 4096 May 5 13:19 /usr
drwxr-xr-x 7 root root 4096 Mar 24 15:51 /usr/local
drwx------ 2 root root 4096 May 5 14:21 /usr/local/bin
-rwxr-xr-x 1 root root 10319072 May 5 14:21 /usr/local/bin/nvim
I'm running a custom OS by the company Siemens that is called "Siemens Industrial OS"; it is basically a Debian Buster with a realtime-patch.
ls -l /usr/local/bin/nvim*
andtype /usr/local/bin/nvim*
and copy&paste the commands and their output. What is your OS? Which version offish
do you use? Maybe this is related: superuser.com/q/1270908/992527noexec
option?https://github.com/waltinator/pathlld
, abash
script to show the permissions, mount options along the path to an object or objects.