When I install the lua5.2 package on Ubuntu 16.10:

sudo apt-get install lua5.2

it installs /usr/bin/lua as a symlink to /etc/alternatives/lua-interpreter, which in turn is a symlink to `/usr/bin/lua5.2.

When I install the lua-5.3 package, it doesn't create the symlinks; I only get /usr/bin/lua5.3.

The output of dkg -L lua5.X, which lists the files owned by the package, is identical (aside from version numbers on some files) for the lua5.2 and lua5.3 packages.

What I want to do is just install the latest and greatest version of Lua, which is currently 5.3, and be able to use #!/usr/bin/lua in scripts.

I know I can work around this by creating the symlinks manually or by using the update-alternatives command (which I haven't yet figured out, but that's not what I'm asking about).

My question is, why does the lua5.3 package not set up the /usr/bin/lua symlink when I install it, while the lua5.2 package does? Is this deliberate, perhaps an Ubuntu policy, or is it just an oversight by the people who created the package?

up vote 6 down vote accepted

Because the package maintainer didn't provide the alternatives infrastructure. Unfortunately no way around it but to set it up manually or just plain symlink /usr/bin/lua to /usr/bin/lua5.3.

I've submitted a bug report: https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212

This is still an issue in 18.04 Bionic. Workaround:

sudo update-alternatives --install /usr/bin/lua lua-interpreter \
/usr/bin/lua5.3 130 --slave /usr/share/man/man1/lua.1.gz \
lua-manual /usr/share/man/man1/lua5.3.1.gz

sudo update-alternatives --install /usr/bin/luac lua-compiler \
/usr/bin/luac5.3 130 --slave /usr/share/man/man1/luac.1.gz \
lua-compiler-manual /usr/share/man/man1/luac5.3.1.gz

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.