I am trying to install apache solr and I am following this tutorial. The problem is when I am trying to run bin/install_solr_service.sh --strip-components=2 it tells that

Supported OPTIONS include:

-d     Directory for live / writable Solr files, such as logs, pid files, and index data; defaults to /var/solr

-i     Directory to extract the Solr installation archive; defaults to /opt/
         The specified path must exist prior to using this script.

-p     Port Solr should bind to; default is 8983

-s     Service name; defaults to solr

-u     User to own the Solr files and run the Solr process as; defaults to solr
         This script will create the specified user account if it does not exist.

-f     Upgrade Solr. Overwrite symlink and init script of previous installation. 
NOTE: Must be run as the root user

Why is it showing this error when I am already running it as root? Please help me out. Thanks in advance.

This is the output for ls -lh /opt:

total 38M

drwxrwxrwx 7 root root 4.0K Apr 29 09:48 android-studio
drwxr-xr-x 2 root root 4.0K Jun  2 20:35 bin
drwxr-xr-x 3 root root 4.0K Nov 18  2015 google
drwxr-xr-x 5 root root 4.0K Jun  3 12:21 solr-5.5.1
drwxr-xr-x 5 root root 4.0K Jun  2 20:43 solr-6.0.1
-rw-r--r-- 1 root root  38M Jun  2 20:28 solr-6.0.1-src.tgz
drwxr-xr-x 4 root root 4.0K May 16 14:54 sublime_text
drwxr-xr-x 4 root root 4.0K May 16 11:30 teamviewer
  • Do you still have this issue? – Elder Geek Sep 18 '17 at 13:54

Being the root user is not the problem.

It looks like the tutorial contains a mistake. The --strip-components part of the command is actually part of the tar command found in the previous step.

The error message you're receiving is actually telling you that the option you're entering isn't one of the supported options in the list. The part about being the root user is just a note.

When compared to the tutorial found here you'll see that --strip-components is used in the unpacking of the .tar file.

  • When I ran : sudo bash ./install_solr_service.sh solr-5.5.1-src.tgz it throws out another error, Extracting solr-5.5.1-src.tgz to /opt ERROR: Expected directory /opt/solr-5.5.1-src not found after extracting solr-5.5.1-src.tgz ... script fails. Am I supposed to run this in /opt? I even tried installing in /opt , there again it throws the same error. What is happening @Arronical? – Horcrux Jun 3 '16 at 6:53
  • I've not installed solr myself so not entirely sure. Could you edit your question to include the output of ls -lh /opt please. – Arronical Jun 3 '16 at 8:18
  • I edited my question – Horcrux Jun 4 '16 at 7:33
  1. Go to /tmp directory

    cd /tmp
  2. check the website for updated version and type wget url_path_to_the_zip_file

    wget http://www.us.apache.org/dist/lucene/solr/6.6.1/solr-6.6.1-src.tgz
  3. Extract the archive contents

    tar xzf solr_zip_name path to install_solr_service.sh --strip-components=2 
    tar xzf solr-6.6.1-src.tgz solr-6.6.1/solr/bin/install_solr_service.sh --strip-components=2
  4. Run the install script

    sudo ./install_solr_service.sh solr-6.0.1.tgz

you can follow some steps from this guide on GitHub


download solr zip file

from http://www-eu.apache.org/dist/lucene/solr/6.6.1/

unzip the file
open command prompt n go to the Solr folder and start the solr

$ bin/solr start -e cloud -noprompt

open your browser and open the link: http://localhost:8983/solr/#/

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.