New Swift Package Repository for Ubuntu/Debian Linux Distributions

Hi everybody,
I have set up a new Swift apt package repository for easy install of Swift on Ubuntu/Debian Linux distributions using the apt package manager.
https://swiftlang.xyz

Repository Install and Usage

There are 2 simple steps to use the repository:-

  1. Install the package repository using the quick install script.
    curl -s https://swiftlang.xyz/install.sh | sudo bash

  2. Install Swift
    sudo apt install swiftlang

The repository supports the following distributions and architectures -

  • Ubuntu 18.04 / 20.04 / 21.04 - x86_86 / amd64 / aarch64 / arm64 / armv7
  • Debian 10 / buster - x86_86 / amd64 / aarch64 / arm64 / armv7 / armhf
  • Raspbian buster - aarch64 / arm64 / armv7 / armhf

The Swift .deb packages are created from the following sources -

Swift package versions are as follows -

  • All 64bit versions are Swift 5.4.1-Release
  • All 32bit versions are Swift 5.1.5-Release

The repository uses all the standard Ubuntu/Debian security and digital signing certificates as well as ssl site encryption.

Current packages available are -

/var/www/swiftlang.xyz/public_html/ubuntu ~
swiftlang |   5.4.1-01-ubuntu18.04 |  bionic | amd64
swiftlang |  5.4.1-7-ubuntu-bionic |  bionic | arm64
swiftlang |   5.4.1-01-ubuntu20.04 |   focal | amd64
swiftlang |  5.4.1-15-ubuntu-focal |   focal | arm64
swiftlang | 5.4.1-8-ubuntu-hirsute | hirsute | arm64
~
/var/www/swiftlang.xyz/public_html/debian ~
swiftlang |  5.4.1-8-debian-buster | buster | arm64
swiftlang | 5.1.5-01-debian-buster | buster | armv7
~
/var/www/swiftlang.xyz/public_html/raspbian ~
swiftlang | 5.1.5-01-raspbian-buster | buster | armhf
~

Uninstall Repository

You can remove the repository use if you need to using -
curl -s https://swiftlang.xyz/remove.sh | sudo bash

Testing with Docker

If you wish to test the repository without installing on your main system the easiest way is to use a docker container.

# start a ubuntu 20.04 docker container 
docker run --security-opt seccomp=unconfined -it ubuntu:20.04 /bin/bash 
# inside the container
apt update
apt install curl
curl -s https://swiftlang.xyz/install.sh | bash
apt install swiftlang

Moving Forward

The main motivation behind creating this repository is as a 'proof of concept' for an official Swift.org apt repository. To explore and test the technologies required and provide a real world testing environment.

Please try out the repository and provide feedback on your experiences.

I have included a live Usage Statistics page on the website to track usage and get an idea of what hardware requirements will be needed.

Thanks for your time and I look forward to your feedback.

33 Likes

Cool!

Repository Package Update.

I have rebuilt the .deb packages with uniform naming and iteration numbers. The release versions of the different arch types now align.

/var/www/swiftlang.xyz/public_html/ubuntu ~
swiftlang |        5.4.1-01-ubuntu-bionic |  bionic | amd64, arm64
swiftlang |         5.4.1-01-ubuntu-focal |   focal | amd64, arm64
swiftlang | 5.5-2021-07-09-a-ubuntu-focal |   focal | amd64, arm64
swiftlang |       5.4.1-01-ubuntu-hirsute | hirsute | arm64
~
/var/www/swiftlang.xyz/public_html/debian ~
swiftlang | 5.4.1-01-debian-buster | buster | arm64
swiftlang | 5.1.5-01-debian-buster | buster | armv7
~
/var/www/swiftlang.xyz/public_html/raspbian ~
swiftlang | 5.1.5-01-raspbian-buster | buster | armhf

Developer Snapshots

I have added a 'dev' section to the repository for the latest developer snapshots.
Run the following command to install the 'dev' section -

curl -s https://swiftlang.xyz/install-dev.sh | sudo bash

If you run apt-cache policy swiftlang you will see what versions are available -

apt-cache policy swiftlang

swiftlang:
  Installed: 5.4.1-01-ubuntu-focal
  Candidate: 5.5-2021-07-09-a-ubuntu20.04
  Version table:
     5.5-2021-07-09-a-ubuntu20.04 500
        500 https://swiftlang.xyz/ubuntu focal/dev amd64 Packages
 *** 5.4.1-01-ubuntu-focal 500
        500 https://swiftlang.xyz/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

Note: Snapshots are only available for ubuntu-focal (20.04) at the moment.

To install the latest version of swift version run the apt install command -

sudo apt install swiftlang

You can also specify which version to install by adding the package version number -

sudo apt install swiftlang=5.4.1-01-ubuntu-focal

To remove the 'dev' section run the standard install script -

curl -s https://swiftlang.xyz/install.sh | sudo bash
6 Likes

Great work !

Repository Update to Swift 5.4.2

I have just pushed Swift version 5.4.2 to the swiftlang.xyz repository.
You can install Swift 5.4.2 using sudo apt update and then sudo apt upgrade.

If you just want to update Swift and not any other packages that might be available, use sudo apt install swiftlang


# check current swift version
ubuntu@ip-172-31-17-153:~$ swift --version
Swift version 5.4.1 (swift-5.4.1-RELEASE)
Target: x86_64-unknown-linux-gnu

# run update
ubuntu@ip-172-31-17-153:~$ sudo apt update
Hit:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 https://swiftlang.xyz/ubuntu focal InRelease [5156 B]
Get:6 https://swiftlang.xyz/ubuntu focal/main amd64 Packages [523 B]
Fetched 334 kB in 1s (347 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

# update available
ubuntu@ip-172-31-17-153:~$ apt list --upgradable -a
Listing... Done
swiftlang/release 5.4.2-01-ubuntu-focal amd64 [upgradable from: 5.4.1-01-ubuntu-focal]
swiftlang/now 5.4.1-01-ubuntu-focal amd64 [installed,upgradable to: 5.4.2-01-ubuntu-focal]

# run upgrade
ubuntu@ip-172-31-17-153:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
swiftlang
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 342 MB of archives.
After this operation, 42.0 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://swiftlang.xyz/ubuntu focal/main amd64 swiftlang amd64 5.4.2-01-ubuntu-focal [342 MB]
Fetched 342 MB in 38s (8983 kB/s)
(Reading database ... 97764 files and directories currently installed.)
Preparing to unpack .../swiftlang_5.4.2-01-ubuntu-focal_amd64.deb ...
Unpacking swiftlang (5.4.2-01-ubuntu-focal) over (5.4.1-01-ubuntu-focal) ...
Setting up swiftlang (5.4.2-01-ubuntu-focal) ...
Processing triggers for man-db (2.9.1-1) ...

# check new swift version
ubuntu@ip-172-31-17-153:~$ swift --version
Swift version 5.4.2 (swift-5.4.2-RELEASE)
Target: x86_64-unknown-linux-gnu
1 Like

Developer Snapshot Updated to Swift 5.5-2021-07-15-a

I have just pushed the latest Swift developer snapshot to the swiftlang.xyz repository.

If you the developer repository installed (curl -s https://swiftlang.xyz/install-dev.sh | sudo bash) you can install latest snapshot using sudo apt update and then sudo apt upgrade.

# check current swift version
ubuntu@ip-172-31-24-100:~$ swift --version
Swift version 5.5-dev (LLVM d26cc0e18da572f, Swift 6a80196da3cbbb3)
Target: x86_64-unknown-linux-gnu

# run update
ubuntu@ip-172-31-24-100:~$ sudo apt update
Hit:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 https://swiftlang.xyz/ubuntu focal InRelease [5156 B]
Get:6 https://swiftlang.xyz/ubuntu focal/dev amd64 Packages [528 B]
Fetched 334 kB in 1s (333 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

# update available
ubuntu@ip-172-31-24-100:~$ apt list --upgradable -a
Listing... Done
swiftlang/release 5.5-2021-07-15-a-ubuntu-focal amd64 [upgradable from: 5.5-2021-07-09-a-ubuntu-focal]
swiftlang/now 5.5-2021-07-09-a-ubuntu-focal amd64 [installed,upgradable to: 5.5-2021-07-15-a-ubuntu-focal]
swiftlang/release 5.4.2-01-ubuntu-focal amd64

# run upgrade
ubuntu@ip-172-31-24-100:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
swiftlang
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 334 MB of archives.
After this operation, 5146 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://swiftlang.xyz/ubuntu focal/dev amd64 swiftlang amd64 5.5-2021-07-15-a-ubuntu-focal [334 MB]
Fetched 334 MB in 36s (9389 kB/s)
(Reading database ... 97795 files and directories currently installed.)
Preparing to unpack .../swiftlang_5.5-2021-07-15-a-ubuntu-focal_amd64.deb ...
Unpacking swiftlang (5.5-2021-07-15-a-ubuntu-focal) over (5.5-2021-07-09-a-ubuntu-focal) ...
Setting up swiftlang (5.5-2021-07-15-a-ubuntu-focal) ...
Processing triggers for man-db (2.9.1-1) ...

# check new swift version
ubuntu@ip-172-31-24-100:~$ swift --version
Swift version 5.5-dev (LLVM 473bb9eb9557b06, Swift b14f2b993493ef5)
Target: x86_64-unknown-linux-gnu
1 Like
Terms of Service

Privacy Policy

Cookie Policy