@modesta
To install Lua modules on Linux, you can follow these steps:
- Use the package manager specific to your Linux distribution to install the Lua interpreter. For example, on Debian-based systems (e.g. Ubuntu), you can run the following command:
sudo apt-get install lua5.3
This command installs the latest stable version of Lua. You can replace lua5.3 with lua5.2 or lua5.1 depending on your system's available version.
- Install the luarocks package manager, which helps to easily install Lua modules. For Debian-based systems, run:
sudo apt-get install luarocks
- Use luarocks to install Lua modules. For example, if you want to install the luasocket module, run:
sudo luarocks install luasocket
This command fetches the luasocket module from the LuaRocks repository and installs it in your Lua module path.
- By default, luarocks installs modules in system directories. However, if you need to install modules locally (without administrative permissions), you can use the --local flag. For instance:
luarocks install --local luasocket
This command installs the luasocket module in the current user's home directory.
Note that some modules may have additional dependencies. You can generally find information about a module's specific installation requirements in its documentation.