How To Install luarocks on CentOS 7

In this tutorial we learn how to install luarocks on CentOS 7. luarocks is A deployment and management system for Lua modules

Introduction

In this tutorial we learn how to install luarocks on CentOS 7.

What is luarocks

LuaRocks allows you to install Lua modules as self-contained packages called “rocks”, which also contain version dependency information. This information is used both during installation, so that when one rock is requested all rocks it depends on are installed as well, and at run time, so that when a module is required, the correct version is loaded. LuaRocks supports both local and remote repositories, and multiple local rocks trees.

We can use yum or dnf to install luarocks on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install luarocks.

Install luarocks on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install luarocks using yum by running the following command:

sudo yum -y install luarocks

Install luarocks on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install luarocks using dnf by running the following command:

sudo dnf -y install luarocks

How To Uninstall luarocks on CentOS 7

To uninstall only the luarocks package we can use the following command:

sudo dnf remove luarocks

References

Summary

In this tutorial we learn how to install luarocks on CentOS 7 using yum and dnf.