How to install and run Swift on Linux

Setup

PATH="/.../<absolute-path-to-the-extracted-swift-folder>/usr/bin:$PATH"
sudo apt-get install \
binutils \
git \
gnupg2 \
libc6-dev \
libcurl4 \
libedit2 \
libgcc-9-dev \
libpython2.7 \
libsqlite3-0 \
libstdc++-9-dev \
libxml2 \
libz3-dev \
pkg-config \
tzdata \
uuid-dev \
zlib1g-dev
swift --version # you should see something similar to Swift version 5.5.2 (swift-5.5.2-RELEASE) 
Target: x86_64-unknown-linux-gnu

Create an example app

mkdir swift-app 
cd swift-app
swift package init --type executable
.build/debug/swift-app # or swift run # it should print Hello, world!

--

--

--

https://alexadam.dev/

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Creating My First Django Application Part 2

Hey Google, translate this!

Apache Kafka Series [Part 1]: Introduction to Apache Kafka

AWS CodeCommit on OSX & unable to access / returned error: 403

3 problem-solving skills I learned as a maintenance engineer that you can use right now

Lawsuits and Trials

lawsuits and trials

Schema Activation? How is schema.org important?

Schema Activation? How is schema.org important?

EJABBERD USING AMAZON EC2 (AWS) AND XML RPC FOR ANDROID XMPP CHAT PART -3

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
alex adam

alex adam

https://alexadam.dev/

More from Medium

Working with Issue Links in OneDev

Install xcodegen package on Mac with HomeBrew

Deploying a Swift API on AWS Elastic Container Service with CodePipeline

Best practices: 5 Risks to Assess for a Secure CI Pipeline