setup crashes right after asking for the port number. How can I fix this?

Edit /etc/nsswitch.conf and turn off the 'db' services if you're not using them. (This problem tends to appear on Debian Linux systems.)