Swift is a safe, fast, expressive general-purpose programming language build for the software design patterns. It is best for the systems programming, to mobile and desktop applications. Swift provides a large number of features that make programming easier while giving the developer the control needed in a true systems programming language.
This tutorial will help you to install swift programming language on your Ubuntu 18.04 LTS Bionic Linux system.
Login to your Ubuntu 18.04 system using SSH (Shell) access. Now install the required dependencies for swift installation on your system.
sudo apt-get install clang
For the new Ubuntu 18.04 installation, I also needed to install following packages to work swift properly.
sudo apt-get install libcurl3 libpython2.7 libpython2.7-dev
Now, you need to download the latest available swift release from its official site. You can use below command to download Swift 4.2.1 on the Ubuntu 18.04 Bionic system.
wget https://swift.org/builds/swift-4.2.1-release/ubuntu1804/swift-4.2.1-RELEASE/swift-4.2.1-RELEASE-ubuntu18.04.tar.gz
Then extract the downloaded archive
tar xzf swift-4.2.1-RELEASE-ubuntu18.04.tar.gz sudo mv swift-4.2.1-RELEASE-ubuntu18.04 /usr/share/swift
Also, configure the swift binary to system’s PATH environment variable.
echo "export PATH=/usr/share/swift/usr/bin:$PATH" >> ~/.bashrc source ~/.bashrc
Use the following command to check the current installed Swift version on your system.
swift --version Swift version 4.2.1 (swift-4.2.1-RELEASE) Target: x86_64-unknown-linux-gnu
Just type swift on your system console and you will get Swift console. You can use this console for quick operations and for the learning purpose.
swift Welcome to Swift version 4.2.1 (swift-4.2.1-RELEASE). Type :help for assistance. 1>
Now, run some sample commands to test the console running properly.
The post How to Install Swift on Ubuntu 18.04 LTS appeared first on TecAdmin.
Go to Source
Author: Rahul
NVIDIA JetPack 4 reached its end-of-life (EOL) in November 2024, marking the end of security…
This blog is contributed by Pushkar Kulkarni, a Software Engineer at Canonical. Building on the…
This blog is contributed by Vladimir Petko, a Software Engineer at Canonical. The release of…
The apt package manager is responsible for installing .deb packages on Ubuntu LTS (long-term support)…
Today we are announcing chiseled containers for OpenJRE 8, 17 and 21 (Open Java Runtime…
Java has long been the most popular language for software development in large enterprises, with…