1.centos7 The 5.1.4 is already installed by default
① View current LUA version number: Lua-v
Lua 5.1.4 Copyright (C) 1994-2008 lua.org, Puc-rio
② See the location of Lua and Luac: which Lua Luac
/usr/bin/lua
/usr/bin/luac
2. Compiling the Lua5.3 version
① Download lua-5.3.3.tar.gz
②make Linux
Error occurred: Lua.c:80:31:fatal error:readline/readline.h:no such file or directory
Indicates that a dependent library needs to be installed: Yum install Readline-devel
③make Install
CD src && mkdir-p/usr/local/bin/usr/local/include/usr/local/lib/usr/local/man/man1/usr/local/share/lua/ 5.3/usr/local/lib/lua/5.3
CD src && install-p-M 0755 Lua Luac/usr/local/bin
CD src && install-p-M 0644 lua.h luaconf.h lualib.h lauxlib.h lua.hpp/usr/local/include
CD src && install-p-M 0644 liblua.a/usr/local/lib
CD Doc && install-p-m 0644 lua.1 Luac.1/usr/local/man/man1
As you can see, LUA and Luac are installed in the/usr/local/bin
④lua-v view version, Discover or old version, then we will/usr/bin in the LUA and Luac removed, and then the/usr/local/bin in the LUA and Luac to create a ln to/usr/bin
Cd/usr/bin
RM-RF Lua Luac
Ln-s/usr/local/bin/lua/usr/bin/lua
Ln-s/usr/local/bin/luac/usr/bin/luac
Lua-v
Lua 5.3.3 Copyright (C) 1994-2016 lua.org, Puc-rio
Install Lua5.3 on CentOS7