DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Frameworks
  4. Easily Install Swift on Linux

Easily Install Swift on Linux

Essentially, you can download a snapshot and you're good to go.

Rob Allen user avatar by
Rob Allen
·
Apr. 28, 16 · Tutorial
Like (5)
Save
Tweet
Share
6.64K Views

Join the DZone community and get the full member experience.

Join For Free

This is the simplest set of steps that I've found so far in order to get Swift on (Ubuntu) Linux. Essentially, you can download a snapshot and you're good to go.

If you're not already on Ubuntu 15.10, create a VM. Vagrant is an easy way to do this:

$ vagrant init ubuntu/wily64
$ vagrant up
$ vagrant ssh

Install the dependencies:

$ sudo apt-get install clang libicu-dev vim

(Vim isn't an actual dependency, but I can't cope with terminal that doesn't have it!)

Grab a Swift snapshot & untar:

$ cd ~
$ curl -O https://swift.org/builds/development/ubuntu1510/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a-ubuntu15.10.tar.gz
$ mkdir swift
$ tar xzf swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a-ubuntu15.10.tar.gz -C swift --strip-components 1

I've used the latest snapshot as of this writing: check the website for the latest one as it is updated regularly.

The binaries are now in ~/swift/usr/bin, so add that to your path and you're good to go:

$ echo 'export PATH=~/swift/usr/bin:$PATH' >>~/.profile
$ source ~/.profile

Prove it works:

$ swift --version
Swift version 3.0-dev (LLVM 752e1430fc, Clang 3987718dae, Swift 36739f7b57)
Target: x86_64-unknown-linux-gnu

Now, you just need to learn Swift!

Swift (programming language) Linux (operating system)

Published at DZone with permission of Rob Allen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Express Hibernate Queries as Type-Safe Java Streams
  • A Brief Overview of the Spring Cloud Framework
  • How To Check Docker Images for Vulnerabilities
  • Event Driven 2.0

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: