Manual Installation
Step 1 - System Update and Install dependencies
First run a system update and upgrade.
sudo apt update && sudo apt upgrade
Then install dependencies.
sudo apt install curl ca-certificates gnupg
Step 2 - Add repository security key
curl -fsSL https://archive.swiftlang.xyz/swiftlang_repo.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/swiftlang_repo.gpg.key
Step 3 - Add repository sources list to /etc/apt/sources.list.d/ directory
NOTE: The the following command is on one line
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/swiftlang_repo.gpg.key] https://archive.swiftlang.xyz/[DIST] [RELEASE] [REPO]" | sudo tee /etc/apt/sources.list.d/swiftlang.list > /dev/null
# Change [DIST], [RELEASE] and [REPO] to suit your installation
# [DIST] = (ubuntu or debian)
# [RELEASE] =( buster or bullseye for debian) (bionic, focal, hirsute, impish or jammy for ubuntu)
# [REPO] = (main, dev, etc.) see documentation for details of repository sections available.
# example for ubuntu focal main repository.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/swiftlang_repo.gpg.key] https://archive.swiftlang.xyz/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/swiftlang.list > /dev/null
Step 4 - Run update and install Swift
sudo apt update
sudo apt install swiftlang