Install Swift on Debian for Swift development.

A Comprehensive Guide to Install and Use Swift on Ubuntu: Easy Step-by-Step Instructions, PATH Exporting, and Missing Dependency Handling.

  • Table of contents

sudo apt-get update
sudo apt-get install libncurses5 clang libcurl4 libpython2.7 libpython2.7-dev wget

Download package

sudo mv swift*RELEASE* /opt/swift/

Export path

Add Swift to your PATH variable using your shell's config file.


echo "export PATH=/opt/swift/usr/bin:$PATH" >> ~/.zshrc


echo "export PATH=/opt/swift/usr/bin:$PATH" >> ~/.bashrc

Open a new terminal and type swift --version to confirm.

Handle missing dependencies

If you see:

version `GLIBCXX_3.4.26' not found (required by swift)

Try these steps:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo apt-get upgrade libstdc++6