How to Install Apache Spark on Debian 11

Install Apache Spark on Debian 11

In this article, we will have explained the necessary steps to install Visual Studio Code on Debian 11. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Install Apache Spark on Debian 11

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo apt update
sudo apt upgrade
sudo apt install curl apt-transport-https

Step 2. Install Java.

Run the following commands to install the Java packages:

sudo apt install default-jdk

This would install Java in the machine. You can check it using the command java -version:

java --version

Step 3. Install Apache Spark on the Debian system.

Now go to the official Apache Spark download page and grab the latest version (i.e. 3.2) at the time of writing this article:

wget https://dlcdn.apache.org/spark/spark-3.1.2/spark-3.1.2-bin-hadoop3.2.tgz

Run the following command to extract the Apache Spark tar file:

tar -xvzf spark-3.1.2-bin-hadoop3.2.tgz

Move the extracted Spark directory to /opt directory:

mv spark-3.1.2-bin-hadoop3.2/ /opt/spark

Next, edit the ~/.bashrc file:

nano ~/.bashrc

Add the following lines:

export SPARK_HOME=/opt/spark
export PATH=$PATH:$SPARK_HOME/bin:$SPARK_HOME/sbin

Then, activate the Spark environment variable:

source ~/.bashrc

That’s all you need to do to install the Apache Spark on Debian (Bullseye). I hope you find this quick tip helpful. For further reading Apache Spark on Debian’s system, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.