How to run INSTALL.sh file on Linux using Terminal

Author: John Stephens
Date Of Creation: 2 January 2021
Update Date: 1 July 2024
Anonim
How to install or run .sh file in linux
Video: How to install or run .sh file in linux

Content

The Linux operating system provides many simple ways to assist users in installing new programs, such as through the Ubuntu Software Center and Synaptic Package Manager. However, some applications still have to be installed from the command console. This article will show you how to install an application from the INSTALL.sh file using the command line.

Steps

  1. Download the software you want to download. Essential files are usually compressed into .tar, .tgz or .zip files.

  2. Extract the file ".tar" or ".zip" (if needed). If the software you have downloaded is in an archive file format like ".tar", ".tgz" or ".zip", you will need to perform a decompression operation to get the .sh file. If the downloaded file is in ".sh" format, skip this step. Use one of the following methods to extract an archive:
    • Right-click the downloaded archive and select Extract Here (Extract here) (content displayed may vary by Linux version).
    • If you are using the terminal, use the command "cd ~ / path"to go to the directory where the archive is stored. Replace" path "with the path to the directory (eg" cd ~ / Downloads ").
    • To unzip ".tar" or ".tar.gz" files using the terminal, use "tar -xvf filename.tar"and press"Enter". Replace" filename "with the name of the file (such as" tar -xvf jdk-14.0.2_linux-x64_bin.tar.gz ")
    • To extract the ".zip" file from the terminal, you will use the command "unzip filename.zip"and press"Enter". Replace" filename "with the name of the zip file (such as" unzip Minecraft.zip ").

  3. Find the container file ".sh". To do this, you need to double-click on the unzipped folder and do a search to see which directory contains the install.sh file.

  4. Open a terminal window. The terminal program has a black desktop icon with a text pointer. Click this icon in the dock or the Applications menu to open the terminal program.
    • The fastest way to do this in most window managers is to press the "Ctr + Alt + T"on the keyboard.
  5. Access the path of the unzipped folder. Import "cd ~ /"and followed by the path to the" .sh "file, then press"Enter". Use a slash mark (/) to separate folders. For example, if the file is saved in the Downloads folder, you would type" cd ~ / Downloads / jdk-14.0.2_linux-x64_bin / bin " and press Enter.
    • To make sure you have the correct folder open, enter "ls -a"at the command console and press"EnterYou will see similar file and folder listings.
  6. Import chmod + x install.sh and press ↵ Enter. If the installation file has a different name, you need ″ install.sh ″ with the exact name of the file. This is the action that enables the executable of the setup file. There is not any confirmation message displayed after this command.
    • If you don't see the error message, it means the original file is executable.
    • You can also do this outside the terminal. The procedure will be different depending on the Linux distribution. To do this on Ubuntu simply right-click on the ".sh" file and choose Properties (Properties). Click the card Permissions (Access permissions) and check the "Allow executing file as program" checkbox.
  7. Import bash install.sh and press ↵ Enter. If the file has a different name, you will replace "install.sh" with the correct file name. For example, to install Netbeans you would type "bash netbeans-8.2-linux.sh"and press"Enter’.
    • You can use some other commands like "sh install.sh"or"./install.sh". If the filename is not" install.sh ", make sure to replace it with the correct filename, then press"Enter". Use one of the commands above and press"Enter’.
  8. Enter your password to access your computer and press ↵ Enter. Application installation will be executed immediately after this action.
  9. Follow the on-screen instructions to complete the installation. Depending on the application, you must enter additional information to complete the installation.
    • To uninstall certain software using the terminal you need to enter the command "dpkg -list"to open a list of installed programs on a Linux operating system. Find the program you want to uninstall and enter the command"sudo apt-get -purge remove "and press"Enter". Enter your computer password and press"Enter"All that's left is to follow the necessary instructions to uninstall the program.
    advertisement