How To Install cl-cffi on Ubuntu 22.04

In this tutorial we learn how to install cl-cffi on Ubuntu 22.04. cl-cffi is Common Foreign Function Interface for Common Lisp

Introduction

In this tutorial we learn how to install cl-cffi on Ubuntu 22.04.

What is cl-cffi

cl-cffi is:

CFFI, the Common Foreign Function Interface, purports to be a portable foreign function interface for Common Lisp. The CFFI library is composed of a Lisp-implementation-specific backend in the CFFI-SYS package, and a portable frontend in the CFFI package.

The CFFI-SYS backend package defines a low-level interface to the native FFI support in the Lisp implementation. It offers operators for allocating and dereferencing foreign memory, calling foreign functions, and loading shared libraries. The CFFI frontend provides a declarative interface for defining foreign functions, structures, typedefs, enumerated types. It is implemented in portable ANSI CL making use of the low-level operators exported by CFFI-SYS.

A UFFI compatibility layer is also being developed.

There are three methods to install cl-cffi on Ubuntu 22.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install cl-cffi Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install cl-cffi

Install cl-cffi Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install cl-cffi

Install cl-cffi Using aptitude

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

sudo aptitude update

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

sudo aptitude -y install cl-cffi

How To Uninstall cl-cffi on Ubuntu 22.04

To uninstall only the cl-cffi package we can use the following command:

sudo apt-get remove cl-cffi

Uninstall cl-cffi And Its Dependencies

To uninstall cl-cffi and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:

sudo apt-get -y autoremove cl-cffi

Remove cl-cffi Configurations and Data

To remove cl-cffi configuration and data from Ubuntu 22.04 we can use the following command:

sudo apt-get -y purge cl-cffi

Remove cl-cffi configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge cl-cffi

References

Summary

In this tutorial we learn how to install cl-cffi package on Ubuntu 22.04 using different package management tools: apt, apt-get and aptitude.