Tuesday, March 9, 2021
Advertisement
Home Linux Tutorials Debian How to Install Swift on Debian 10 (Buster)

How to Install Swift on Debian 10 (Buster)

Level of difficulty: Easy,
Approximate time required: 15 minutes

Introduction

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.

Prerequisites

  • 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 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:

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

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:

swift -version

Expected output of a successful install:

Swift version 5.1.3 (swift-5.1.3-RELEASE)
Target: x86_64-unknown-linux-gnu

Conclusion

Congrats on Installing Swift on your Debian 10 server!

Please feel free to leave a comment!

 

 

 

4 COMMENTS

  1. When installing Swift 5.5.5 (current version), I get:
    swift: error while loading shared libraries: libedit.so.2: cannot open shared object file: No such file or directory

    Any ideas how to fix this?

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

How to Install PHP 7.4 on CentOS 7

Level of difficulty: Beginner, Easy Approximate time required: 25 minutes Introduction PHP is a server-side scripting language used for web development. PHP is a really powerful tool...

How to Install Swift 5.2 on Debian 10 (Buster)

Level of difficulty: Easy, Approximate time required: 15 minutes Introduction Swift is an open source programming language developed by Apple. It’s a fast and interactive programming language...

How to Use SCP Linux to Securely Copy Files (SCP Examples)

Introduction SCP or secure copy is a command line tool that allows you to securely transfer files between two locations. With SCP you can: — Transfer...

How to Uninstall PHP 7.4 on Ubuntu 18.04

Level of difficulty: Easy, Approximate time required: 15 minutes Introduction PHP is a server-side scripting language used for web development. PHP is a really powerful tool for...

Recent Comments