Swift is a famous language that was developed by Apple to create software applications. Swift is an open-source language that is used as a fast and interactive programming language to develop various software for all platforms and servers. Writing a Swift code is interactive since the syntax is quite concise. Swift also contains multiple features that are useful for developers. The code written in Swift is safe for designing and extremely fast, as well. This article shows you how to install Swift on a Debian 10 server.

This tutorial will be of great help to all Debian users who wish to install Swift on their computers. We will be using Debian 10, but even if you do not have the latest version of Debian installed on your system, feel free to follow the same procedure on your computer.

Prerequisites

  • Debian 10
  • A sudo user

Installing Swift in Debian 10

To install Swift in Debian, open the terminal using the Ctrl Alt T shortcut, then follow the

steps listed below:

Step 1: Updating Packages

To update your packages, run the following command in the terminal window:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_1.jpg" data-lazy- height="26" src="data:image/svg xml,” width=”536″>

The above command will begin to update the packages of your Debian server.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_2.jpg" data-lazy- height="244" src="data:image/svg xml,” width=”1170″>

Step 2: Installing Required Dependencies

To install all the dependencies required to install Swift on a Debian 10 server, issue the following command in the terminal window:

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_3.jpg" data-lazy- height="64" src="data:image/svg xml,” width=”1182″>

After some time, the system will prompt you to ask you for permission to continue. Press Y to confirm and then press the Enter key to continue.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_4.jpg" data-lazy- height="706" src="data:image/svg xml,” width=”1122″>

Using this method, users can install and update all of the required dependencies on their servers.

Step 3: Installing Swift

The next step is to install Swift on the Debian server. Because there is no pre-defined method for installing Swift on a Debian system, we use the following link to install Swift on our Ubuntu 18.04 system. The latest version available at the time of writing this article is 5.1.3. If there is another version available when you are implementing this method, then feel free to opt for that version by using the following command to get the latest archive version of Swift:

$ wget https://swift.org/builds/swift-5.1.3-release/ubuntu1804/swift-5.1.3-RELEASE/swift-5.1.3-RELEASE-ubuntu18.04.tar.gz

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_5.jpg" data-lazy- height="60" src="data:image/svg xml,” width=”1174″>

After that, the download will be completed, and an archive file will be saved.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_6.jpg" data-lazy- height="422" src="data:image/svg xml,” width=”1172″>

Once the download of the Swift package has been completed, extract this newly downloaded archive file. Execute the following command in the terminal window:

$ tar xzf swift-5.1.3-RELEASE-ubuntu18.04.tar.gz

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_7.jpg" data-lazy- height="26" src="data:image/svg xml,” width=”986″>

Next, move this newly extracted folder to the opt directory using the following command:

$ sudo mv swift-5.1.3-RELEASE-ubuntu18.04 /opt/swift/

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_8.jpg" data-lazy- height="32" src="data:image/svg xml,” width=”1060″>

Step 4: Configuring PATH Environment Variable

You must add the Swift installation path into the PATH environment variable of your system. To do so, issue the following command:

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_9.jpg" data-lazy- height="28" src="data:image/svg xml,” width=”1154″>

After that, issue the following:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_10.jpg" data-lazy- height="32" src="data:image/svg xml,” width=”564″>

This marks an end to the process of installing and configuring Swift on the Debian 10 server.

Step 5: Verifying Installation Process

To verify the installation of Swift, issue the following command in the terminal window:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_11.jpg" data-lazy- height="32" src="data:image/svg xml,” width=”534″>

The output will display the version of Swift installed on your server. This output indicates a successful installation process.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/How-to-Install-Swift-in-Debian-10-_12.jpg" data-lazy- height="90" src="data:image/svg xml,” width=”638″>

Conclusion

This article showed you a step-by-step method for installing Swift on a Debian 10 server. After installing Swift, you can also verify the installation using the last step in this tutorial.

About the author

<img alt="Karim Buzdar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/01/echo/karim-150×150.png60120b21b99bb.jpg" height="112" src="data:image/svg xml,” width=”112″>

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.