68

I'm new to Ubuntu and know installing programs only from window. It is very easy there: Just double-click the setup.exe and the things start.

But how do I install a program on Ubuntu?

I want to install something which I couldn't find in the Ubuntu Software Center. I downloaded a .sh file and now I don't know what to do with it.

Tim
  • 32,861
  • 27
  • 118
  • 178
cberg
  • 805
  • 1
    Thank you for your answer, but I want to install something which I couldn't find in the Ubuntu Software Center. I downloaded a .sh file and now I don't know what to do with it :) Oh my god, what a stupid question ;) – cberg Nov 08 '11 at 19:52
  • Oh, okay. I thought there would maybe be a way which I could go with all installations I will do in the future. – cberg Nov 08 '11 at 19:58
  • 2
    general advice is not to install random stuff from the internet - its the quickest way to get into all sorts of trouble :) – fossfreedom Nov 08 '11 at 20:01
  • 2
    it's no "random stuff from the internet" I want to install, it's just netbeans ;) I think I have to learn much :) Thank you for your help! – cberg Nov 08 '11 at 20:07
  • ok ... just edit your question with this info ... you should edit your title to reflect this. Also add to your question where you have downloaded this file. – fossfreedom Nov 08 '11 at 20:09
  • 1
    ... also add what version of ubuntu you have installed - i've also found this question - does this help you? http://askubuntu.com/questions/21561/how-to-install-jdk-and-netbeans – fossfreedom Nov 08 '11 at 20:12
  • i found a question where i can find the solution for my netbeans problem. but this question is still interesting for me :) – cberg Nov 08 '11 at 20:12
  • 1
    related: http://askubuntu.com/questions/75401/problem-installing-netbeans-7-0-1 – lgarzo Nov 08 '11 at 20:21

4 Answers4

87

First you might need to give the .sh file permission to execute. chmod +x file.sh, then you can execute it with ./file.sh.

You can also right-click on the file, select Properties, then select Permissions and then select 'Allow executing file as program'. Then you double-click the file and select 'Run in Terminal' or 'Run'.

Anonymous
  • 11,699
16

An .sh file in Ubuntu is pretty much the same as a .bat or .wsh file is in Windows. What the program does, or how it works, is completely up to the developer. It is not possible to answer "how to install an .sh-file", except to say "read the README".

It's poor practice to provide such programs. You should always look for .deb files, which is roughly comparable to .msi files in Windows, I believe. That is, you'll double click it, and it'll get installed.

  • 1
    It's why we're here. :) The key thing to understand is that this doesn't have anything to do with the operating system. It's about how the developers of an app chooses to make it available. Unfortunately, some companies are lazy when it comes to Linux. They think "oh, Linux users are experts, so we don't need to make our programs user friendly". They are wrong, because experts and geeks are the laziest people of them all. If anyone wants user-friendly, we do. The developers of NetBeans obviously do not care about Ubuntu. That will change very soon, or NetBeans will be forgotten. – Jo-Erlend Schinstad Nov 09 '11 at 04:37
5

You can the file permission via the command line console in your Ubuntu.

Open a Terminal Window and type:

chmod 777 downloaded_file.sh

After you changed the file attribute, you can execute those file directly via terminal window or click it when you use file manager. Your installation file should be working now.

Bruno Pereira
  • 73,643
shayan
  • 51
  • 3
    Better might be chmod +x downloaded_file.sh as this version doesn't give every user of the computer read and write access to that file. – thirtythreeforty Feb 02 '13 at 22:50
2

It is a shell script file, so you don't necessarily need execute permissions on it. You may run it in gnome-terminal using sh downloaded_file.sh. It works because it is just a text file, and sh interprets it line by line.

meskobalazs
  • 2,913