How can I run an executable from a CD when it doesn't have the executable bit set?

26,765

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
Share:
26,765

Related videos on Youtube

RusGraf
Author by

RusGraf

My goal here is usually to document.

Updated on September 17, 2022

Comments

  • RusGraf
    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

    1. Double-click on the folder 'LINUX'
    2. Double-click on the file 'INSTALL.BIN'
    3. 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
      Admin over 13 years
      What kind of file is it? 'file /media/BDH\ DE/linux/install.bin '?
    • Admin
      Admin over 13 years
      Ah-ha. Bizarrely, it is actually just a text file with a .bin filename extension. How aggravatingly misleading.
    • Admin
      Admin over 13 years
      Yeah - 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
    Silver Moon almost 11 years
    yeah, right, very good, worked well.
  • Admin
    Admin over 7 years
    I 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.