Swift 5.1.3 build doesn't work on Ubuntu 18.04.1 LTS

Running swift build (5.1.3) from anywhere on Linux 18.04.1 LTS (Bionic Beaver x64) causes this error:

error: toolchain is invalid: could not find the `swiftc` at expected path /usr/share/swift/usr/bin/swiftc

The error does not occur with Swift 5.1.3 on Ubuntu 16.04..., but appears on 18.04.1 LTS with Swift 5.1.2 too.
Idk if this matters, but my hosting is Hostinger.com btw :slightly_smiling_face:

The last installation was with my script

Steps to reproduce:

  • Install OS
  • Auth as root
  • Create a user
  • Grant user sudo access
  • Run script:
    sudo apt-get update
    wget https://gist.github.com/maximkrouk/7e74d1c02ba473ab0b6c4f87f095fa9a
    unzip 7e74d1c02ba473ab0b6c4f87f095fa9a.zip
    cd 7e74d1c02ba473ab0b6c4f87f095fa9a-55d9e3c3d3a654a0c02b1445c80bdebcfda5dba3
    chmod +x install-swift-5.1.3-RELEASE-ubuntu18.04
    ./install-swift-5.1.3-RELEASE-ubuntu18.04

But the error appears even with this bunch of dependencies btw:

    sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync libstdc++6 sudo libssl-dev libz-dev

Shouldn't be too hard to debug, look in /usr/share/swift/usr/bin/, there should be a symbolic link from swiftc to swift. If it's there, try running /usr/share/swift/usr/bin/swiftc --version to make sure it works.

Terms of Service

Privacy Policy

Cookie Policy