The problem of running PIE executables / There is no application installed for "shared library" files.
As described here, position independent ELF executables aren't properly recognized by file
and in turn nautilus sometimes, making it impossible to run them (gives an error "There is no application installed for "shared library" files."):
https://stackoverflow.com/questions/55060402/electron-executable-not-recognized-by-nautilus
Workarounds can be tricky for new users, and lead them to do things they weren't meant to do that are unsafe (like mess with file permissions, or install .desktop files in the wrong place, ...). Therefore I suggest this is fixed.
There seems to be some attempts to fix this in the file
tool to address this: https://bugs.launchpad.net/ubuntu/+source/file/+bug/1747711 However, it seems like it isn't actually that easy to tell a library and executable apart, one participant in the discussion suggesting that: "This indicates a clear boundary between shared libraries and PIC executables just does not exist."
I suggest the Nautilus team re-evaluate the situation and consider enabling users to easily run executables again in some way, if feasible. These are the ideas I could think of to maybe move forward with:
-
One solution might be, if it is truly not impossible to tell apart libraries and executables, to make a best guess that errs on detecting it as executable if unclear (which is not the side whatever tool Nautilus currently uses to detect the type appears to fall on) and allow attempting to run it if in doubt.
-
One other way might be, since Nautilus already allows click-and-running a
.desktop
file (at least if running text files is set to either be allowed or lead to an ask prompt), to extend the .desktop file specification to allow relative paths, and to teach accompanying tools likegtk-run
to pick up.desktop
files from absolute paths, such that that this problem can be solved by being able to accompany a.desktop
file without the need to install anything. -
One additional approach could be to establish a file extension, or other additional marker, that clearly identifies a file as executable. Unintentionally or not,
.sh
seems to do this job right now for Nautilus, but obviously naming a non-script ELF that can't actually be run with any shell with an.sh
ending is its own rabbit hole of potential user confusion. (Or is that a common thing to do? I've seen installers ending in.sh
, but I always assumed they actually would start out running in bash or sh, even if containing a packged binary afterwards.) One ending that could work for this maybe could be.bin
, such that ELF or PIE contents +.bin
= runnable binary.
Surely there is some way to solve this that can be found to re-enable easy sharing of directly runnable programs on Linux outside of package managers. (And please let's not discuss the downsides of this over using a package manager and/or building from source, I know some people think it shouldn't be done anyway, but some use cases do exist for this outside of purely proprietary software.) My apologies if there is already a duplicate ticket for this, but I couldn't find one.