Swift on Linux: Make very first step work

后端 未结 5 856
灰色年华
灰色年华 2021-02-19 20:19

I am totally new to swift. It has just been released as open source for linux and I wanted to try it. This is on ubuntu 14.04. clang is installed as per prerequisites.

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-19 20:48

    Had the same issue, what I missed was that I didn't get the keys for the package and verify it before extracting.

    1. Download the package
    2. wget -q -O - https://swift.org/keys/all-keys.asc | gpg --import
    3. gpg --keyserver hkp://pool.sks-keyservers.net --refresh-keys Swift
    4. gpg --verify swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz.sig
    5. tar xzf swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz
    6. add PATH=/path/to/usr/bin:"${PATH}" to your .bashrc
    7. finally run swift

    You should see:

    Welcome to Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift 778f82939c). Type :help for assistance.
    1> 1+1
    $R0: Int = 2
    

提交回复
热议问题