After downloading Spark, you need to set the path for SPARK_HOME in the .bashrc file. Execute the below command to open the .bashrc file,
After this hit the insert button on your keyboard to edit the .bashrc file. Now, set the SPARK_HOME path as below,
SPARK_HOME=<enter the spark directory path here>
After this, source the .bashrc file with the below command,
Now, everything is set up. You can run the spark shell now.