Disclaimer: I'm new to Linux, it could be I did something wrong, I was sent here from linuxmint-help channel.
On Linux Mint 14 Cinnamon I had a .bin file. Even with run permission double click would give me "unknown file type" error. It run perfectly through the terminal though, with "./filename.bin".
I asked on the linuxmint-help channel and I was told to remove the ".bin" from file name and now it works with double click. Why it didn't work with the ".bin" extension?
This is definitely a bug as if it runs with ./filename.bin, it means its already marked as executable.
I would assume a correct action for any unknown file type that's marked as executable should be the same as the action of a script file (gives option to run/terminal/display). As a suggestion, maybe an "open with..." could be added or replace display for unknown file types.
Should be fixed.
I'm having the same problem on a fresh Linux Mint 19 Cinnamon install. The affected executables are my own software, build on the same machine, and properly marked as executable in file permissions.
The "file" command in terminal reports this:
ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=25da6594fd3481af5679897ad5a074a875b59a51, with debug_info, not stripped
The "Type" field in Nemo file "Properties" dialog is: Unknown (application/x-sharedlib)
When viewing parent folder contents in "List View", the column also reports "Unknown" in the "Type" column. Looks like Nemo MIME identification/handling is mixed up?
The warning message only appears when attempting to launch it from Nemo, but not via CLI. Neither does this issue occur when double clicking files associated with my programs (one is an image viewer bound to .jpg extension) in Nemo.
Looks like Nemo inherited this bug from Nautilus:
https://www.mail-archive.com/[email protected]/msg722902.html
So, this bug only happens when double clicking on 64-bit executables, but not for 32-bit ones.
Ok, after some more digging, I found out why this bug exists.
In a nutshell:
1) 64-bit executables need Position Independent Execution (PIE) to allow memory usage over 4 GB.
2) the ELF (executable file format) already supported PIE, it was used for 32-bit shared libraries, which by their very nature require PIE.
3) When 64-bit support was added, rather than adding a new 'file type' type field besides 'executable' and 'library' (ET_EXEC and ET_DYN, respectively), developers decided to use 'library' (instead of adding a new type, e.g. 'executable64').
So essentially, 64-bit executables are indistinguishable from shared libraries, or at least by the "file" command (or equivalent library) that Nemo (and other file managers) have always used internally.
I wrote my own ELF parser some time ago, I should have some code in there that properly detects the difference between a 64-bit library and 64-bit executable.
Ideally, the "file" command (application) should be patched to properly detect them as "application/x-executable" instead of "application/x-sharedlib", but I suspect this would cause problems, or it'd have been fixed long ago?
Nemo could however add a workaround to peek inside ELF files, _before_ detecting the mime type with other (currently 'broken') libraries. But I'm not sure if the Nemo developers are open to that sort of solution.
*Edit: looks like this may be fixed upstream soon-ish:
https://bugs.launchpad.net/ubuntu/+source/file/+bug/1747711
have same problem on Arch Linux
Same problem on fresh install of Min 19 with cinnamon. Trying to open a wallet-qt but says unknown file type, from terminal ./wallet-qt works
Another year has past, upstream fix does not appear to be forthcoming. In the mean while, perhaps a workaround in Nemo would be more suited?
To fellow commenters above, it may help if you gently nudge the thread below:
https://bugs.launchpad.net/ubuntu/+source/file/+bug/1747711
Same behaviour here with a no extension x64 electron app, (like this comment suggests https://bugs.launchpad.net/ubuntu/+source/file/+bug/1747711/comments/10)
File property shows as Unknown (application/x-sharedlib)
Count me in as well. No extension x64 program executes fine in the shell via ./ but asks for "Open with" if double clicked in Nemo. (Latest Mint)
Most helpful comment
have same problem on Arch Linux