0

I can't install a .sh file. When I double click the file then it is open with archive manager not get any run or run in terminal option.

I also checked the permission on allow executing file as program

Radu Rădeanu
  • 169,590
bechitra
  • 51
  • 2
  • 2
  • 7

2 Answers2

3

To run .sh file, using a terminal is the best way.

Assuming your file is in /home/user/downloads directory;

To open a terminal press ALT+CTRL+T together. Once the terminal is opened, type pwd to locate which directory currently you're in. pwd will display an output like below

/root/folder/

If your .sh file is in user's downloads directory as I mentioned above, then use cd command to navigate to the downloads folder. see below;

cd /home/user/downloads

once entered, again check whether you're in that directory by using pwd command. If you're in that directory then simply type ls command to list down the files. Once you see your .sh file, simply type below command to execute the file.

sudo sh shell_file.sh

terminal will ask you to type the root (admin) password which will not be visible while you type. simply type the password & enter. That's it, the execution will process.

This is just an assumption; assuming your file located in a directory. I hope this very basic and simplified process which will make you more clear.

Hope it helps! :)

EDIT: I've edited the document by adding sh command at the last step.

AzkerM
  • 10,270
  • 6
  • 32
  • 51
  • when i using this method at the last step means when i type sudo myfile.sh and press enter it says command not found – bechitra Jan 18 '14 at 12:52
  • my bad.. I'm so sorry that I missed sh command at the last step.. please try it again let us know. :) – AzkerM Jan 18 '14 at 14:34
  • Now it says- install.sh(my filename):31:install.sh:function:not found ubuntu install.sh:46: install.sh syntax error: "}" unexpected – bechitra Jan 19 '14 at 04:41
  • Hmm pretty strange.. is that .sh file created by you or downloaded from any source to achieve something?? Can you try; sudo bash ./file_name.sh instead :) – AzkerM Jan 19 '14 at 04:48
  • Please accept the answer if it works. So the question will not be queued anymore. :) – AzkerM Jan 23 '14 at 05:15
-1

first give full permission to that .sh file

sudo chmod 755 YOUR_FILENAME

second run .sh file by following command inside ur CLI

sudo ./YOUR_FILENAME

**YOUR_FILENAME is full path of your file, where it is situated.

Yash Vekaria
  • 147
  • 4