Installing Bazel on Debian
To install Bazel on Debian, you can go through the following steps:
Pre-requisites
Before we begin, make sure that you have the following installed in your system:
- Java 8 or higher
- Python 2.7 or higher (Python 3 is also supported)
Step 1: Add Bazel repository
First, you need to add the Bazel repository to your system. For that, follow these steps:
- Add Bazel distribution URI as a package source:
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
- Import the public key of the Bazel repository:
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
Step 2: Update apt-get and install Bazel
After adding the Bazel repository, update apt-get and install the Bazel package:
- Update apt-get:
sudo apt-get update
- Install Bazel:
sudo apt-get install bazel
Step 3: Verify the installation
To verify the installation of Bazel, simply run:
bazel version
This command should print the current version of Bazel installed on your system.
That's it! You have successfully installed Bazel on your Debian system.