Let's install the Swift toolchain and run our first Swift code on Linux:
- We need to install some dependencies related to the compiler. If you are using Ubuntu with a Graphical User Interface (GUI), open up a Terminal window and run the following from the prompt to update the software repositories:
sudo apt-get update
- Run the next command to install a number of dependencies required for the Swift toolchain:
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 \
zlib1g-dev
The Swift team released a prebuilt toolchain for Ubuntu, so we will need to download the latest released version and the associated signature file. Links for these releases can be found...