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

A code is a medium for change

Basics before starting with Robotics — Part 6

Import large python packages into AWS Lambda using AWS EFS(ELASTIC FILE SYSTEM)

Finding maximum size subarray with sum K in a given array

Finding maximum size subarray with sum K in a given array

Spark Streaming Basic Concepts -1 譯

Digital Events — an Overview of Software Options Curated by a Pro

Understanding your Rails Application Structure

Getting started with Microservices Architecture

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

How to Create Your Own iOS Password Generator

Use async URLSession with server-side Swift

GitHub Actions for iOS

Testing sending email on Laravel Vapor using AWS SES