Script tested on Ubuntu 22.04 LTS GUI and Server version. Ubuntu was virtualized using UTM on an M1 Mac. This Bash script automates the process of installing BCC (BPF Compiler Collection) on Linux. The script installs the necessary packages and dependencies.
-
Clone the repository:
git clone https://github.com/your-username/bcc_ubuntu22.04_installer.git
-
Navigate to the repository:
cd bcc_ubuntu22.04_installer
-
Make the script executable:
chmod +x bcc_installer.sh
-
Run the script:
./bcc_installer.sh
Follow the on-screen prompts and enter your root password when prompted.
- After the script completes, a test will be performed using the
opensnoop
tool to ensure the correctness of the installation. - If you replace sign "&" to ";" in 58 line, you will see windows with running opensnoop. This is what a working opensnoop program looks like:
- Ubuntu 20.04 or newer
- Root access to install packages and dependencies
- The script performs the following tasks:
- Asks the user for the root password.
- Checks for the availability of sudo and updates the system.
- Installs required packages and dependencies for eBPF development.
- Builds BCC from source.
- Performs a test installation by running the
opensnoop
program.
- The github site BCC project: click here
- The eBPF ducumentation: click here
Note: Ensure you have the correct root password and necessary permissions to install packages.