Execute a .run file in current folder from Terminal

I downloaded a .run executable file recently to install some software on Ubuntu and was having some problems.

First off, setting the permissions to "Execute file as program" under file properties through the GUI was NOT doing the trick. It would inform me that I needed to run this file with root privileges.



This obviously led me to the terminal... where I would need to navigate to the correct folder and set privileges as such then execute with sudo (which is how I was instructed to do so on several forums and websites. Spoiler alert: BS)

...~$ chmod -x sample.run
...~$ sudo sample.run

I would then receive an error message something like this

sudo: sample.run: command not found

I was kind of lost there for awhile and didn't know what to do. I knew that the file was there and I knew I was following instructions that I could find precisely. SO...

Here is the detail that eluded me. Apparently when you execute a .run file, even from your current directory, it requires an explicit file path. From the current directory you have to add the prefix ./ to the .run file name. For example:

...~$ sudo ./sample.run
Hope this saves someone some time and frustration. Peace.

No comments:

Post a Comment