1

I recently re-installed Ubuntu in 64 bit, (before I had it in 32 bit). I had the home folder on a partition and the system on another. So when I re-installed I kept my old home folder. My problem is that now, when I try to run my c++ executables that use the SDL, Nautilus tells me:

Could not display "program"

There is no application installed for "shared library" files.
Do you want to search for an application to open this file?

So the problem seems to be that nautilus thinks that it's a "shared library", but I have no idea about how to fix it!

How do I make it recognize as a normal executable file?

file program return :

program: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=39330e8ffbc9d3c5392da418d7fabecbb32334eb, stripped

and mimetype program return :

program: application/x-sharedlib
  • Could you please try to run the exectuable(s) in a terminal and edit your question to include its/their output? What's the output of file /path/to/exe? Thanks. – David Foerster Jan 14 '17 at 20:00
  • In fact, if I run the program in a terminal it works, but I can't launch it from nautilus – dido22 Jan 14 '17 at 20:02
  • 1
    Could you please include the output of file <EXE> and mimetype <EXE> then? – David Foerster Jan 14 '17 at 20:06
  • So the problem seems to be more global and not only related to nautilus. I removed the nautilus tag. – dido22 Jan 15 '17 at 14:40
  • The problem seems to be that g++ marks the file as a "position independent executable" and that when mimetype see that, it thinks that it's a shared library. So no solution seem possible, but I wonder why not everybody has this problem, 'cause I don't think that everybody use position dependent executables ! – dido22 Jan 16 '17 at 18:31
1

This appears to be long-running bug:

https://bugzilla.gnome.org/show_bug.cgi?id=737849

I, too, would like to see it sorted out.

Regards

Peter

| improve this answer | |
0

I don’t think Nautilus team will sort it out soon The problem is between Nautilus and file/libmagic project. file/libmagic cannot distinguish between shared objects and executables in a reliable way. So, when I sometimes need to execute binaries from Nautilus, I either drag it into a terminal window or create a one-word script. However, when I need to execute binaries more frequently, I switch to another file managers: Dolphin or Nemo. Dolphin, as I understand, is just executing any file with "execute" permission. Nemo asks in case of shared object: "Make executable and run" or "Choose a program".

| improve this answer | |
0

I created a script "RunFromThunar.sh"

#!/bin/bash
exec $1

... and in Thunar I associated "shared library" with this script. It works!
It must work in Nautilus the same way.

| improve this answer | |
0

I updated Ubuntu to 19.10. There are no changes to this problem. Nautilus still refuses to run 64-bit executable. Even after file/libmagic was fixed. Now the compiled executable is reported as "ELF 64-bit LSB pie executable" and not as before "ELF 64-bit LSB shared object". However, the Nautilus team did not change their approach, and I do not understand their reasons. If they want to protect users from accidentally clicking on a malware file, then a simple pop-up warning will be enough. (See the MS Windows warning when starting unsigned programs.) But, If they really want to completely ban the launch of malware, then this is simply impossible. There are many ways to trick inexperienced users.
What is worse for me is that Nemo (version 4.0.6) stopped offering "Make executable and run". (I mostly used Nemo before 19.10.) Either Nemo team shares Nautilus security fears, or they just copied part of the code from Nautilus. Dolphin does not lose the common sense. But, I am not ready to completely switch to Dolphin in GNOME environment.
I would like to mention once again when I need to run binaries from the file manager. I don't need it, when I install downloaded programs. Then a desktop launcher is the most appropriate option. But, when I am developing or researching, I can keep different versions of the complied executable file of the same program. Then I need to run the binary files from the file manager.
It seems that Nautilus team will not change their approach. Finally, I found a best solution for me. I created a desktop launcher that gets the file name and passes it as a command to the shell. Example below:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Run Executable
Comment=Run Executable
Exec="/bin/sh" -c %f
Icon=application.png
Terminal=false

I saved this launcher in ~/.local/share/applications as RunExecutable. So, I can select this launcher in "All Applications" list from "Open With" menu. This made my life as comfortable as before. Thus, I solver this problem in Nautilus & latest Nemo. However, I did not resolve my disagreement with the Nautilus teams. Nautilus should run executables in a straightforward way.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.