{"id":15056983,"url":"https://github.com/mar0ls/bcc_ubuntu22.04_installer","last_synced_at":"2026-01-02T01:57:44.889Z","repository":{"id":225707745,"uuid":"766633033","full_name":"mar0ls/bcc_ubuntu22.04_installer","owner":"mar0ls","description":"Installer BPF Compiler Collection (BCC) on Ubuntu 22.04 LTS","archived":false,"fork":false,"pushed_at":"2024-03-03T20:12:17.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T04:28:11.921Z","etag":null,"topics":["autoinstaller","bash-script","ebpf","gcc","kernel","linux","python3"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mar0ls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-03T19:43:10.000Z","updated_at":"2024-10-06T02:59:09.000Z","dependencies_parsed_at":"2024-03-03T21:25:02.529Z","dependency_job_id":"d488b74f-b3ef-4c95-b71e-8e777734c64a","html_url":"https://github.com/mar0ls/bcc_ubuntu22.04_installer","commit_stats":null,"previous_names":["mar0ls/bcc_ubuntu22.04_installer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fbcc_ubuntu22.04_installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fbcc_ubuntu22.04_installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fbcc_ubuntu22.04_installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar0ls%2Fbcc_ubuntu22.04_installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mar0ls","download_url":"https://codeload.github.com/mar0ls/bcc_ubuntu22.04_installer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243558478,"owners_count":20310574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autoinstaller","bash-script","ebpf","gcc","kernel","linux","python3"],"created_at":"2024-09-24T21:59:45.438Z","updated_at":"2026-01-02T01:57:44.872Z","avatar_url":"https://github.com/mar0ls.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv id=\"header\" align=\"center\"\u003e\n  \u003cimg src=\"https://media0.giphy.com/media/1C8bHHJturSx2/200.webp?cid=790b7611datxhh3500rt5fult0n20dg3q8ksjcmy1cr5snrh\u0026ep=v1_gifs_search\u0026rid=200.webp\u0026ct=g\" width=\"400\"/\u003e\n\u003c/div\u003e\n\n# BCC installer on ubuntu 22.04 LTS\nScript tested on Ubuntu 22.04 LTS GUI and Server version. Ubuntu was virtualized using UTM on an M1 Mac.\nThis Bash script automates the process of installing BCC (BPF Compiler Collection) on Linux. The script installs the necessary packages and dependencies.\n \n## Usage\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/your-username/bcc_ubuntu22.04_installer.git\n    ```\n\n2. Navigate to the repository:\n\n    ```bash\n    cd bcc_ubuntu22.04_installer\n    ```\n\n3. Make the script executable:\n\n    ```bash\n    chmod +x bcc_installer.sh\n    ```\n\n4. Run the script:\n\n    ```bash\n    ./bcc_installer.sh\n    ```\nFollow the on-screen prompts and enter your root password when prompted.\n\n6. After the script completes, a test will be performed using the `opensnoop` tool to ensure the correctness of the installation.\n7. If you replace sign \"\u0026\" to \";\" in 58 line, you will see windows with running opensnoop. This is what a working opensnoop program looks like:\n   \n\u003cimg width=\"1103\" alt=\"Zrzut ekranu 2024-03-3 o 16 09 29\" src=\"https://github.com/mar0ls/bcc_ubuntu22.04_installer/assets/120790937/5978d137-d034-432d-bc9b-f56de30afcae\"\u003e\n\n\n## Requirements\n\n- Ubuntu 20.04 or newer\n- Root access to install packages and dependencies\n\n## Notes\n\n- The script performs the following tasks:\n  - Asks the user for the root password.\n  - Checks for the availability of sudo and updates the system.\n  - Installs required packages and dependencies for eBPF development.\n  - Builds BCC from source.\n  - Performs a test installation by running the `opensnoop` program.\n\n## Ubuntu 24.04 lts\nYou can install bcc in Ubuntu 24.04 LTS from apt package\n```bash\nsudo apt-get install bpfcc-tools linux-headers-$(uname -r)\n```\nor from binary source\n```bash\n\n#!/bin/bash\n\nset -e\n\nRED='\\033[0;31m'\nGREEN='\\033[0;32m'\nNC='\\033[0m' \n\necho -n \"Enter your root password: \"\nread -s ROOT_PASSWORD\necho\n\nhandle_error() {\n  local exit_code=$?\n  echo -e \"${RED} [!!!] Error: Command failed with exit code $exit_code${NC}\"\n  exit $exit_code\n}\n\ntrap 'handle_error' ERR\n\necho $ROOT_PASSWORD | sudo -S true || {\n  echo -e \"${RED} [!!!] Error: Incorrect root password or sudo not available.${NC}\"\n  exit 1\n}\n\necho -e \"${GREEN} Updating package list...${NC}\"\necho $ROOT_PASSWORD | sudo -S apt update\n\necho -e \"${GREEN} Installing dependencies...${NC}\"\necho $ROOT_PASSWORD | sudo -S apt install -y zip bison build-essential cmake flex git libedit-dev \\\n  libllvm18 llvm-18-dev libclang-18-dev python3 zlib1g-dev libelf-dev libfl-dev python3-setuptools \\\n  liblzma-dev libdebuginfod-dev arping netperf iperf3 libpolly-18-dev\n\necho -e \"${GREEN} Cloning BCC repository...${NC}\"\ngit clone https://github.com/iovisor/bcc.git\nmkdir bcc/build \u0026\u0026 cd bcc/build\n\necho -e \"${GREEN} Configuring build with CMake...${NC}\"\necho $ROOT_PASSWORD | sudo -S cmake ..\necho -e \"${GREEN} Building BCC...${NC}\"\nmake -j$(nproc)\necho $ROOT_PASSWORD | sudo -S make install\n\necho -e \"${GREEN} Installing Python bindings...${NC}\"\necho $ROOT_PASSWORD | sudo -S cmake -DPYTHON_CMD=python3 ..\ncd ../src/python\nmake -j$(nproc)\necho $ROOT_PASSWORD | sudo -S make install\ncd ../../\n\necho -e \"${GREEN} Fixing Python shebangs in BCC tools...${NC}\"\necho $ROOT_PASSWORD | sudo -S find /usr/share/bcc/tools -type f -exec sed -i 's|#!/usr/bin/env python$|#!/usr/bin/env python3|' {} \\;\n\necho -e \"${GREEN} Testing BCC installation by running 'opensnoop' for 5 seconds...${NC}\"\nif echo $ROOT_PASSWORD | sudo -S timeout 5 /usr/share/bcc/tools/opensnoop \u003e /dev/null 2\u003e\u00261; then\n  echo -e \"${GREEN} [OK] BCC installed and tested successfully!${NC}\"\nelse\n  echo -e \"${RED}[!!!]Error: 'opensnoop' test failed. Please check the build logs.${NC}\"\nfi\n```\n\n## Reference\n- The github site BCC project: [click here](https://github.com/iovisor/bcc)\n- The eBPF ducumentation: [click here](https://ebpf.io/)\n  \n**Note:** Ensure you have the correct root password and necessary permissions to install packages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar0ls%2Fbcc_ubuntu22.04_installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmar0ls%2Fbcc_ubuntu22.04_installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar0ls%2Fbcc_ubuntu22.04_installer/lists"}