Level of difficulty: Easy,
Approximate time required: 15 minutes
Swift is an open source programming language developed by Apple. It’s a fast and interactive programming language to write software for phones, desktops and servers.
In this tutorial, we will learn how to Install Swift on your Debian 10 Buster Linux server.
- A Debian 10 server
- A sudo user
- A terminal access to Debian 9
Step 1 – Update packages on your Debian 10 system
You can run the following command to update your packages:
sudo apt update
The above command will update packages on your Debian 10 server.
Step 2 – Install the required dependencies
Install the required dependencies on your Debian 10 server by running the following command:
sudo apt-get install libncurses5 clang libcurl4 libpython2.7 libpython2.7-dev
Type Y if asked for confirmation.
This will install the required dependencies for Swift on your Debian 10 server.
Step 3 – Install Swift on your Debian Strech
There is no official download of Swift for Debian 10, however you can use the link provided for installation on Ubuntu 18.04. At the time of writing this article, the latest version of Swift available is 5.1.3
You can use the following command, to get the archive of the latest version of Swift:
After the download is completed successfully, extract the downloaded archive.
tar xzf swift-5.1.3-RELEASE-ubuntu18.04.tar.gz
Then move the extracted folder to opt directory
sudo mv swift-5.1.3-RELEASE-ubuntu18.04 /opt/swift/
Step 4 – Configure PATH environment variable
You will also need to add the swift installation path to your systems PATH environment variable. You can do so by running the following commands:
echo "export PATH=/opt/swift/usr/bin:$PATH" >> ~/.bashrc source ~/.bashrc
Step 5 – Verifying the Install
To verify Swift has been successfully installed and configured,type:
Expected output of a successful install:
Swift version 5.1.3 (swift-5.1.3-RELEASE) Target: x86_64-unknown-linux-gnu
Congrats on Installing Swift on your Debian 10 server!
Please feel free to leave a comment!