Ubuntu 16.04 - swift - failed to launch REPL

Hello

I have programming experience but am installing Swift in Ubuntu for the first time.

Linux nnn 4.15.0-50-generic #54~16.04.1-Ubuntu SMP Wed May 8 15:55:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Swift version 4.1 (swift-4.1-RELEASE)
Target: x86_64-unknown-linux-gnu

swift gives the following error.
error: failed to launch REPL process: process launch failed: failed to bind to port 0 on 127.0.0.1

And
swift package init gives the following error.
Creating executable package: Hello
Creating Package.swift
error: invalidAccess

Anything I miss? Thanks in advance.

nnn

Additionally
strace of swift
and
strace of swift package init --type executable
has the following error.
write(2, "need to run as root or suid", 27need to run as root or suid) = 27

And with sudo, strace gives
write(2, "effective uid is not 0, is /usr/"..., 133effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?) = 133

Could you provide some details on how you install it thus far?
I don't have 16.04 system ready, and I couldn't reproduce it on 18.04.

XCode, Swift runs well in my Mac.

In Ubuntu, when I unzipped the tar and set path, it could not find the lib files available inside the folder.

And I Installed through
sudo snap install swift --edge

snap list shows
Name Version Rev Tracking Publisher Notes
core 16-2.39 6964 stable canonical* core
gtk-common-themes 0.1-16-g2287c87 1198 stable canonical* -
swift 4.1 26 edge lf-araujo -
telegram-desktop 1.7.0 737 stable telegram.desktop -

Till now it is not possible to have swift in Ubuntu 16.04 though I am using it in Mac.

I had given above the installed list, errors on execution and strace output (error part alone).

Thanks

nnn