I'm running a Debian 8.2 vm and trying to execute a file called install.sh.

I've run the following commands:

  • sh ./install.sh
  • sh install.sh
  • apt-get install install.sh

The first two above commands gave me the error "Configuration Absent: Installation Failed". The third command gave me the following output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package install.sh
E: Couldn't find any package by regex 'install.sh'

I've run chmod 700 install.sh to make sure the file CAN be executed.

And I absolutely can't find anything about this type of error.

  • 1
    As which user are you attempting to do this? For which user did you set the permissions to rwx? For what program does the install.sh belong? – Timothy Martin Jun 5 '18 at 23:48
  • 4
    "Configuration Absent: Installation Failed" sounds like an error from within the script itself - it's going to be hard to help without knowing what the script is and what it is supposed to do – steeldriver Jun 5 '18 at 23:49
  • 3
    The 3rd one doesn't do what you think... apt install install.sh will try to install a package named install.sh from Debian's repositories, not a file on your computer. As others have mentioned, it sounds like the first two commands both work. – multithr3at3d Jun 6 '18 at 0:00
  • a .sh is a shell script, so just execute it, with its own permissions or calling a shell to load it ; apt is not for this use. "Configuration absent" really looks like this shell uses an external configuration file for doing something. so if you are lucky developper of this script as given either a --help parameter or commented its script or given a readme file to read. Else, you can ask us to explain the script itself if you copy/paste it on a topic if it is not to big... – francois P Jun 6 '18 at 5:32
  • Let us know where this install.sh script comes from (what software), and also have a read of the installation instructions for that software. It sounds like it either expects you to prepare a configuration file before running the script, or like there is a configuration file somewhere but in a location that the script can't find. – Kusalananda Jun 6 '18 at 5:48

The first two commands will run the script IF it is a shell script. But it might be Python. Or awk. Or a different shell entirely. So to be safe you shouldn't need to mention.sh explicitly, as most well written scripts specify the correct interpreter on the first line.

  1. Make the script executable: chmod a+rx install.sh
  2. Now run it: ./install.sh

The first command is the correct one (so long as the script is in the current directory). The 3rd command is way off. The 2nd will do the same as the first.

The script is running: This is not an error about not being able to run the script. Some command in the script is failing. But that is all I can tell you, because I don't know what is in the script.

You don't need to make it executable to run it as sh script_name. If it has a first line starting #!… then it is designed to be made executable and run as ./script_name.

If the script relies on bash (or other advanced shell) extensions. Then it may not run in sh

To debug a script (if it is a bash script), you can run it as bash -x script_name

It is recommended not to have extensions on executable: If you were to re-write in python, or C, then you would have to rename it. This is not a good think. (if a file is executable then it is executable. It is responsible for selecting its own interpreter (see #!)).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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