How can I run an executable from a CD when it doesn't have the executable bit set?
Solution 1
If the problem is that CDROM was mounted 'noexec' you can remount it executable.
sudo mount -o remount,exec /media/BDH\ DE/
Solution 2
If its not a script/text but a binary:
For 64-bit programs:
/lib64/ld-linux-x86-64.so.2 ./program.bin
For 32-bit programs:
/lib/ld-linux.so.2 ./program.bin
Source:
"To execute binaries, use /lib64/ld-linux-x86-64.so.2 ./program.bin for 64-bit programs and /lib/ld-linux.so.2 ./program.bin for 32-bit ones." – Comment from Lekensteyn on question https://askubuntu.com/a/17311/52853 Apr 13 2012
Solution 3
You can use one of both:
bash -c <command>
or
sh -c <command>
Solution 4
mount CDROM manually with umask=000, i.e.
sudo mount -o umask=000 /dev/sdXY /mount_point
Related videos on Youtube
Comments
-
RusGraf over 1 year
A textbook I'm using came with a CD containing a few supplementary applications. To my pleasant surprise, it appears to include an installer for Linux.
The readme file on the CD provides the following installation instructions:
PC: Linux
- Double-click on the folder 'LINUX'
- Double-click on the file 'INSTALL.BIN'
- Follow instructions on screen.
But doing this just produces the following error message:
Could not display "/media/BDH DE/linux/install.bin". The file is of an unknown type
Attempting to run the installer via the command line results in a permissions error:
ak@aux:~$ ls /media/BDH\ DE/ linux os x readme.txt windows xp windows xp - no java ak@aux:~$ ls -l /media/BDH\ DE/linux/ total 41177 -rw-r--r-- 1 ak ak 42164549 2005-07-26 03:39 install.bin ak@aux:~$ /media/BDH\ DE/linux/install.bin bash: /media/BDH DE/linux/install.bin: Permission denied
While, to my disappointment, the message fails to inform me of what permissions I am lacking, a quick glance at the output of ls reveals that the installer has not been marked executable.
How do I run it?
The type of the file is:
ak@aux:~$ file /media/BDH\ DE/linux/install.bin src/bdh-de/install.bin: POSIX shell script text executable
-
Admin over 13 yearsWhat kind of file is it? 'file /media/BDH\ DE/linux/install.bin '?
-
Admin over 13 yearsAh-ha. Bizarrely, it is actually just a text file with a
.bin
filename extension. How aggravatingly misleading. -
Admin over 13 yearsYeah - figured. So solved? Like if it's a shell script - you can 'bash /media/BDH\ DE/linux/install.bin' or something similar now?
-
Silver Moon almost 11 yearsyeah, right, very good, worked well.
-
Admin over 7 yearsI still think how can i double click on the file and run it. It is still refusing to run if the file has '.bin' extension.