importing posix in Lua 5.2 on bionic fails to load posix.ctype

Bug #1752082 reported by Lars Viklund on 2018-02-27
This bug affects 24 people
Affects Status Importance Assigned to Milestone
lua-posix (Ubuntu)

Bug Description

The following was originally noticed while trying to use Lmod, but can be reproduced with the standalone Lua interpreter. Lmod has worked fine earlier in the alpha, this behaviour is new within the last bunch of days.

lars@mononoke:~$ lsb_release -rd
Description: Ubuntu Bionic Beaver (development branch)
Release: 18.04

lars@mononoke:~$ lua5.2 <<< 'require("posix")'
lua5.2: /usr/share/lua/5.2/posix/init.lua:29: module 'posix.ctype' not found:
 no field package.preload['posix.ctype']
 no file '/usr/local/share/lua/5.2/posix/ctype.lua'
 no file '/usr/local/share/lua/5.2/posix/ctype/init.lua'
 no file '/usr/local/lib/lua/5.2/posix/ctype.lua'
 no file '/usr/local/lib/lua/5.2/posix/ctype/init.lua'
 no file '/usr/share/lua/5.2/posix/ctype.lua'
 no file '/usr/share/lua/5.2/posix/ctype/init.lua'
 no file './posix/ctype.lua'
 no file '/usr/local/lib/lua/5.2/posix/'
 no file '/usr/lib/x86_64-linux-gnu/lua/5.2/posix/'
 no file '/usr/lib/lua/5.2/posix/'
 no file '/usr/local/lib/lua/5.2/'
 no file './posix/'
 no file '/usr/local/lib/lua/5.2/'
 no file '/usr/lib/x86_64-linux-gnu/lua/5.2/'
 no file '/usr/lib/lua/5.2/'
 no file '/usr/local/lib/lua/5.2/'
 no file './'
stack traceback:
 [C]: in function 'require'
 /usr/share/lua/5.2/posix/init.lua:29: in main chunk
 [C]: in function 'require'
 stdin:1: in main chunk
 [C]: in ?

lars@mononoke:~$ dpkg -l lua-posix
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
ii lua-posix:amd64 33.4.0-2 amd64 posix library for the Lua language
ii lua5.2 5.2.4-1.1build1 amd64 Simple, extensible, embeddable programming language

lars@mononoke:~$ dpkg -L lua-posix

Peter Heywood (peethwd) wrote :

This also effects Lmod on my system.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lua-posix (Ubuntu):
status: New → Confirmed
Alex G (flamefire) wrote :

The reason for this happening is that lua-posix changed its main module name from posix_c to posix. The maintainers of the debian package missed that and still install a symlink from /usr/lib/x86_64-linux-gnu/lua/5.1/

This can be seen in the output above (no file '/usr/lib/x86_64-linux-gnu/lua/5.1/') which shows that a is searched for.

The solution for the users is to create a symlink to that file: sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.1/ /usr/lib/x86_64-linux-gnu/lua/5.1/
Or simply rename the to
WARNING: This has to be undone before upgrading after a fix from the package maintainers gets released or the upgrade might fail.

The maintainers should fix that in the packages ASAP.

Thomas (tvk7) wrote :

The link, at least for me, brings up the next error:

module avail
/usr/bin/lua: error loading module 'posix.ctype' from file '/usr/lib/x86_64-linux-gnu/lua/5.2/':
 /usr/lib/x86_64-linux-gnu/lua/5.2/ undefined symbol: lua_tointeger
stack traceback:
 [C]: in ?
 [C]: in function 'require'
 /usr/share/lua/5.2/posix/init.lua:29: in main chunk
 [C]: in function 'require'
 /usr/share/lmod/lmod/libexec/lmod:64: in main chunk
 [C]: in ?

Any clue?

OliFre (freyermuth) wrote :

Debian has just released a fixed package version, lua-posix 33.4.0-3:

It would be best if this could be synced before Bionic Beaver LTS is released with the currently broken version.

Peter Heywood (peethwd) wrote :

@Thomas (Tvk7) it looks like you are using lua 5.2, where as Alex G's symlink solution is for lua 5.1.

The relevant symlink for 5.2 would be:
sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.2/ /usr/lib/x86_64-linux-gnu/lua/5.2/

Egil Hjelmeland (hjelmis) wrote :

We need lua-posix 33.4.0-3 on Bionic

Egil Hjelmeland (hjelmis) wrote :

Works for me: Grab lua-posix 33.4.0-3 binary deb from and install on bionic.

Psychotron (redm) wrote :

Could you pleeeease roll out the simple fix for the simple problem? This breaks all 3rd party software with dependency to lua 5.2 (and probably also 5.3?). It's a PITA to tell all users how to manually fix this problem.

Sebastian Potthoff (sebpo) wrote :

Can confirm and agree with the previous comments. This should have been fixed in the LTS .1 release, but it's not. It breaks my Lmod installation and fixing it manually on a couple of workstations is annoying to say the least. Please roll out 33.4.03!

tags: added: bionic packaging
Nathan (g-nathan) wrote :

Hmm, this is still not fixed! :(
Without the fix you get a window, after logging in, with a stack trace saying "posix.ctype not found".

Erik Lönroth (erik-lonroth) wrote :

This is still not fixed.

Broken. Need to revert to "environment-modules" legacy.

Yes, it looks like we need to go from lua-posix package version 33.4.0-2 to something slightly newer. This is on Ubuntu 18.04.x

Esko Järnfors (esko-jarnfors) wrote :

Please fix this, we are getting the same error with lmod.

This has been fixed in debian at but it is still broken in Bionic.

Esko Järnfors (esko-jarnfors) wrote :

Here's the packaging patch from debian, please fix this issue in bionic.

The attachment "lua-posix-debbug-891541.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.