Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 11.10?

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.

share|improve this question
    
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 8 '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 8 '11 at 19:58
1  
general advice is not to install random stuff from the internet - its the quickest way to get into all sorts of trouble :) –  fossfreedom Nov 8 '11 at 20:01
1  
... also add what version of ubuntu you have installed - i've also found this question - does this help you? askubuntu.com/questions/21561/how-to-install-jdk-and-netbeans –  fossfreedom Nov 8 '11 at 20:12
1  
show 3 more comments

4 Answers

up vote 21 down vote accepted

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'.

share|improve this answer
add comment

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.

share|improve this answer
    
That's good to know, thanks you! –  cberg Nov 8 '11 at 20:21
    
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 9 '11 at 4:37
add comment

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.

share|improve this answer
2  
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 2 '13 at 22:50
add comment

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.

share|improve this answer
add comment

protected by Community Feb 21 at 0:31

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.