How to Run an INSTALL.sh Script on Linux in 4 Easy Steps

 Did you download Linux software that came with an install.sh file? Install.sh is a simple text-based shell script that makes it easy to install software. To use an install.sh script, you'll first need to make it executable using chmod +x install.sh. Then, you can execute the script in a terminal with the command ./install.sh or sudo ./install.sh. This minHour guide will walk you through executing an install.sh file from the Linux command line using Ubuntu, Debian, and any other version of Linux.

Steps

Open a Terminal window.

On most Linux desktop environments, you can open a Terminal by pressing .

  • Before installing software, make sure to check the README or INSTALL file that came in your download for specific instructions and installation options.

Use cd to enter the folder that contains the install.sh script.

For example, if install.sh is in your Downloads folder, type cd ~/Downloads and press to enter that directory.

  • If the file you downloaded is compressed into a TGZ or TAR.GZ archive, be sure to unpack the files first.
  • You can extract a TGZ or TAR.GZ file using the command tar -xzvf filename.tgz.
  • To make sure you’re in the right directory, type ls -a and press Enter. You should see your install.sh file, as well as all other files in the directory.

Make the install.sh file executable.

The trick to getting the install.sh script to run is to change its permissions. To do this, type chmod +x install.sh and press .

  • If you’re unable to change the permissions, you’ll need root access. Instead, run sudo chmod +x install.sh and press Enter.
  • If you don’t see an error, you’ll know the install script is now executable.

Execute the install.sh script.

To do this with root access, type sudo ./install.sh and press .

  • You can also use the command sudo bash install.sh or sudo sh install.sh to run the script.
  • If you’re just installing the software in your own home directory and don’t need root permissions, you can use omit sudo and use ./install.sh instead.
  • Depending on the script and app you’re installing, you may be prompted to complete additional steps to install the software.

Tips

  • Depending on the program, you might wind up with an uninstall.sh script that you can use to uninstall it. To uninstall, make the uninstall script executable with chmod +x uninstall.sh, then run ./uninstall or sudo ./uninstall.
  • You can also change a file’s permissions using your desktop environment’s file manager. In Ubuntu, right-click the “.sh” file, choose Properties, and then click the Permissions tab. Check the box that says “Allow executing file as program,” and then click Close.
  • Once you make install.sh executable using chmod +x, you can also run the script from your desktop environment by double-clicking the file.

Leave a Comment