How To Install lua-resty-core on Debian 12

Learn how to install lua-resty-core on Debian 12 with this tutorial. lua-resty-core is New FFI-based Lua API for NGINX Lua module

Introduction

In this tutorial we learn how to install lua-resty-core on Debian 12.

What is lua-resty-core

lua-resty-core is:

This pure Lua library reimplements part of the ngx_lua module’s Nginx API for Lua with LuaJIT FFI and installs the new FFI-based Lua API into the ngx.* and ndk.* namespaces used by the ngx_lua module. In addition, this Lua library implements any significant new Lua APIs of the ngx_lua module as proper Lua modules, like ngx.semaphore and ngx.balancer. The FFI-based Lua API can work with LuaJIT’s JIT compiler. ngx_lua’s default API is based on the standard Lua C API, which will never be JIT compiled and the user Lua code is always interpreted (slowly).

There are three methods to install lua-resty-core on Debian 12. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install lua-resty-core Using apt-get

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

sudo apt-get update

After updating apt database, We can install lua-resty-core using apt-get by running the following command:

sudo apt-get -y install lua-resty-core

Install lua-resty-core Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install lua-resty-core using apt by running the following command:

sudo apt -y install lua-resty-core

Install lua-resty-core 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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install lua-resty-core using aptitude by running the following command:

sudo aptitude -y install lua-resty-core

How To Uninstall lua-resty-core on Debian 12

To uninstall only the lua-resty-core package we can use the following command:

sudo apt-get remove lua-resty-core

Uninstall lua-resty-core And Its Dependencies

To uninstall lua-resty-core and its dependencies that are no longer needed by Debian 12, we can use the command below:

sudo apt-get -y autoremove lua-resty-core

Remove lua-resty-core Configurations and Data

To remove lua-resty-core configuration and data from Debian 12 we can use the following command:

sudo apt-get -y purge lua-resty-core

Remove lua-resty-core configuration, data, and all of its dependencies

We can use the following command to remove lua-resty-core configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge lua-resty-core

Dependencies

lua-resty-core have the following dependencies:

References

Summary

In this tutorial we learn how to install lua-resty-core package on Debian 12 using different package management tools: apt, apt-get and aptitude.