Swift is a general-purpose programming language that’s approachable for newcomers and powerful for experts. Open-source Swift can be used on the Mac to target all of the Apple platforms: iOS, macOS, watchOS, and tvOS. Open-source Swift can be used on Linux to build Swift libraries and applications.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sudo apt update
sudo apt install clang libicu-dev build-essential pkg-config

VERSION=5.8
wget https://swift.org/builds/swift-${VERSION}-release/ubuntu1804/swift-${VERSION}-RELEASE/swift-${VERSION}-RELEASE-ubuntu18.04.tar.gz
tar xzf swift-${VERSION}-RELEASE-ubuntu18.04.tar.gz

sudo mkdir /swift
sudo mv swift-${VERSION}-RELEASE-ubuntu18.04 /swift/${VERSION}
sudo ln -s /swift/${VERSION}.0/usr/bin/swift /usr/bin/swift
swift --version