DEV Community

stevelatif
stevelatif

Posted on

2

Aya Rust tutorial Part Two - Setting up

© steve latif

Part Two: Setting up the Prerequisites

Assumptions

All the examples will be run on Ubuntu Linux. On other distributions your mileage may vary

First step: setup dependencies

Install packages

$ sudo apt install clang llvm libelf-dev libpcap-dev build-essential libc6-dev-i386  \
graphviz  make gcc libssl-dev bc libelf-dev libcap-dev clang gcc-multilib  \
libncurses5-dev git pkg-config libmnl-dev bison flex linux-tools-$(uname -r)
Enter fullscreen mode Exit fullscreen mode

Verify that you have bpftool installed on your system

$ sudo bpftool prog 
Enter fullscreen mode Exit fullscreen mode

If there are problems installing it from a package, you can install it from source:

$ git clone --recurse-submodules https://github.com/libbpf/bpftool.git
$ cd bpftool/src
$ make -j$(nproc)
$ sudo https://raw.githubusercontent.com/stevelatif/articles/main/blogs/bpftool prog
Enter fullscreen mode Exit fullscreen mode

Install rust, following the instructions at https://rustup.rs/

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Enter fullscreen mode Exit fullscreen mode

Once you have rust and cargo installed and in your path, install the following rust related tools:

$ rustup udpate
$ cargo install cargo-generate
$ cargo install bpf-linker
$ cargo install cargo-generate
$ cargo install rustfmt
$ cargo install bpf-linker
Enter fullscreen mode Exit fullscreen mode

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (1)

Collapse
 
annavi11arrea1 profile image
Anna Villarreal

Setting up rust on a mac was fairly straightforward! Rust is new for me. Havent done much with it yet, so following!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay