I've downloaded a .sh file - how do I install this?

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.


Solution 1:

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

Solution 2:

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.

Solution 3:

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.