Download, build and install Lua 5.4.
Requirements: Linux, bash.
Last checked: 2024-02-07
#!/bin/bash
# Download and install Lua interpreter.
# Last mod.: 2024-02-07
# Last check: 2024-02-07
# Pre-flight requirements
sudo apt install libc-dev
sudo apt install libreadline-dev
# Source code URL
url="https://www.lua.org/ftp/lua-5.4.6.tar.gz"
# Download and unpack
cd /tmp
curl -R -O $url
tar zxf $(basename $url)
cd $(basename $url .tar.gz)
# Install
sudo make clean linux-readline install
lua
Easy way: change last line of script to
sudo make uninstall
.
More conscious way: go to /tmp/lua...
and
sudo make uninstall
from there.