How To Install wasi-libc on Kali Linux

In this tutorial we learn how to install wasi-libc on Kali Linux. wasi-libc is WASI libc implementation for WebAssembly

Introduction

In this tutorial we learn how to install wasi-libc on Kali Linux.

What is wasi-libc

wasi-libc is:

This is a work in progress. It’s usable for many purposes, though the APIs aren’t stable yet. For example, this is used by the Rust compiler to build its standard library for the wasm32-wasi target.

First, it’s a usable libc. It builds a “libc” which can be used by compilers, such as Clang 8.0, using the wasm32-wasi target. It’s a work in progress, but it is already sufficient to run basic programs.

Second, it’s a “reference” implementation, which means the interfaces defined here can be used by other tools and libraries, even if they don’t use all the actual implementations here. For example, we don’t expect everyone will want to use the exact malloc implementation provided here, but tools and libraries using an ABI-compatible malloc interface will be able to interoperate regardless of which actual implementation is used.

Third, it’s an example showing the use of the WASI API. The libc functionality is implemented using calls to WASI functions.

There are three methods to install wasi-libc on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install wasi-libc Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install wasi-libc using apt-get by running the following command:

sudo apt-get -y install wasi-libc

Install wasi-libc Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install wasi-libc using apt by running the following command:

sudo apt -y install wasi-libc

Install wasi-libc Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install wasi-libc using aptitude by running the following command:

sudo aptitude -y install wasi-libc

How To Uninstall wasi-libc on Kali Linux

To uninstall only the wasi-libc package we can use the following command:

sudo apt-get remove wasi-libc

Uninstall wasi-libc And Its Dependencies

To uninstall wasi-libc and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove wasi-libc

Remove wasi-libc Configurations and Data

To remove wasi-libc configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge wasi-libc

Remove wasi-libc configuration, data, and all of its dependencies

We can use the following command to remove wasi-libc configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge wasi-libc

Dependencies

wasi-libc have the following dependencies:

References

Summary

In this tutorial we learn how to install wasi-libc package on Kali Linux using different package management tools: apt, apt-get and aptitude.