Follow these steps to install Lua 5.2.4 on Linux. These instructions are written for Ubuntu Linux 16.04. The steps needed to install Lua are the same on Ubuntu Linux 12.04 and higher:
The entire installation of Lua can be done using the command line, with the apt package manager.
Open up a new Terminal and type sudo apt-get install lua5.2:
Provide your password when prompted and wait for the installation to finish:
Type lua -v. If everything is set up correctly, the Terminal should print out the installed version of Lua (5.2.4):