# 安装依赖库
sudo apt-get -y install libreadline6 libreadline6-dev
# 下载安装包
cd /home/wenjianbao/456 wget -c http://www.lua.org/ftp/lua-5.3.5.tar.gz
# 默认情况下,会被安装到目录 /usr/local/lua,我打算改下,安装到 /alidata/server/lua/lua-5.3
tar -xzvf ./lua-5.3.5.tar.gz cd lua-5.3.5/ make linux test make install INSTALL_TOP=/usr/local INSTALL_TOP=/alidata/server/lua/lua-5.3
# 配置 lua 命令行 工具 和 头文件
sudo ln -s /alidata/server/lua/lua-5.3/bin/lua /usr/local/bin/lua sudo ln -s /alidata/server/lua/lua-5.3/bin/luac /usr/local/bin/luac sudo ln -s /alidata/server/lua/lua-5.3/include/lauxlib.h /usr/local/include/lauxlib.h sudo ln -s /alidata/server/lua/lua-5.3/include/lua.h /usr/local/include/lua.h sudo ln -s /alidata/server/lua/lua-5.3/include/lua.hpp /usr/local/include/lua.hpp sudo ln -s /alidata/server/lua/lua-5.3/include/luaconf.h /usr/local/include/luaconf.h sudo ln -s /alidata/server/lua/lua-5.3/include/lualib.h /usr/local/include/lualib.h
# 测试一下
$ lua -v Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio