New Swift Package Repository for Ubuntu/Debian Linux Distributions

Swift 5.5.1 Release

The repository has been updated with the new swift-5.5.1-RELEASE


Update of the package was aborted (ubuntu 21.10) because it tried to overwrite "/usr/lib/python3/dist-packages/" that's also present in package python3-six 1.16.0-2

Python3-six is installed because I have Caffeine installed, it seems.

$ aptitude why python3-six
i   caffeine     Beroende av python3-xlib           
i A python3-xlib Beroende av python3-six (>= 1.10.0)

@Andreas thanks for the info.
There is a bug in the swift 5.5 build system that includes an old file for some unknown reason.
This is normally removed when building the debian packages but it got missed in this update.
I have just uploaded an updated package so it should all be fixed now.

:ok_hand: Works great

Swift 5.5.2 Release

The repository has been updated with the new swift-5.5.2-RELEASE


Your efforts are most appreciated and I don't want to sound harsh, but I would rather have a list of GPG keys and repo URLs than running a script off the internet with sudo.

1 Like

@futurejones First off, THANKS for this repository. I can't praise you enough for that, in particular because you're doing what – in my opinion – should be the job of the Swift/Server group.

I don't want to put additional burden on you, but I have some suggestions which would tremendously improve the desolate packaging situation for Swift tools on Linux.

I'm developing a bunch of platform independent command line tools written in Swift.

Since static linking is pretty much broken on Linux, it looks like we have to deal with our tools depending on the Swift libraries for the time being. I'm pondering about doing Debian packaging for my tools and requiring your swiftlang package. That said, two things come to my mind:

  1. Since a typical command line tool does not need the swift compiler, but only the runtime libraries, would you consider splitting up swiftlang into two package? One, say, swift-runtime or, e.g., libswift5.5.2, for the runtime libraries (which other packages could depend on) and one for the "rest" of the compiler (which, in turn, depends on its runtime library package).

  2. Would it perhaps make sense to work together on a "larger" repository, so to allow .deb hosting for tools that depend on your swift package in the same repository as the language runtime packages?

I think changes like these could make a huge impact on the availability of swift-based tools for Linux, and, in return, attract more people working on such tools.

What do you think?


@mickeyl thanks for the appreciation and feedback.

I have already been working on making a swift-runtime deb package available.
Rather than split the existing package I have taken the same approach and naming convention as the swift-docker images.
With swift-docker there is the main swift image and a swift-slim image that just contains the swift-runtime.

I have added swiftlang-slim (swift-runtime) for 5.5.2 packages to the main repository for the following distributions -

  • Ubuntu bionic, focal and hirsute
  • Debian buster and bullseye

These are just for arm64 at the moment. I will add slim packages for amd64 as well soon.

They can be installed with sudo apt install swiftlang-slim or added to any swift application deb package as a dependency.

I think it would be a great idea to extend the repository to include all types of swift-based tools for Linux. It would be fairly straight forward to add a dev-tools section to the repository and get started.
Let me know when you have something you want to upload and test.


The issue previously fixed may have resurfaced with the 5.5.2 release.

Selecting previously unselected package swiftlang.
Preparing to unpack .../35-swiftlang_5.5.2-01-debian-buster_amd64.deb ...
Unpacking swiftlang (5.5.2-01-debian-buster) ...
**dpkg:** error processing archive /tmp/apt-dpkg-install-JLmvj2/35-swiftlang_5.5.2-01-debian-buster_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3/dist-packages/', which is also in package python3-six 1.12.0-1
**dpkg-deb:** **error:** paste subprocess was killed by signal (Broken pipe)
Selecting previously unselected package xdg-user-dirs.
Preparing to unpack .../36-xdg-user-dirs_0.17-2_amd64.deb ...
Unpacking xdg-user-dirs (0.17-2) ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

@agenna thanks for the info,
looks like issue fix got missed for the swiftlang_5.5.2-01-debian-buster_amd64.deb package.
I have uploaded a new package swiftlang_5.5.2-02-debian-buster_amd64.deb with the fix.
Should be good to go now.

Repository Update February 2022

Swift 5.5.3 Release

The repository has been updated with the new swift-5.5.3-RELEASE

Slim swift-runtime packages

swiftlang-slim (swift-runtime) packages have been added for all the Ubuntu and Debian releases.

Ubuntu 22.04 Jammy

Ubuntu 22.04 jammy which will be the next LTS version of Ubuntu has been added to the repository.

Raspberry Pi OS 64bit Release

Raspberry Pi has released a 64bit Raspberry Pi OS compatible with all raspberry pi devices from RPi3/RPi4 onwards including the new Raspberry Pi Zero 2 W.
The OS is based on Debian Bullseye so swift toolchains built for Debian Bullseye arm64 will install and run perfectly on this new OS.
The repository fully supports this new OS and the quick install script will auto detect Raspberry Pi OS as Debian Bullseye compatible.
You can now run the latest Swift releases on all your compatible Raspberry Pi devices.

Manual Installation of Repository

For those that do not want to use the quick install script I have added manual installation instructions to the Repository User Guide - About | Swift Community Repository


Thanks a lot for the repo.

Today I tried to install it on Ubuntu 20.04 x64 and got this error:

$ sudo apt install swiftlang
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 swiftlang : Depends: libgcc-5-dev but it is not installable
             Depends: libstdc++-5-dev but it is not installable
E: Unable to correct problems, you have held broken packages.

Hi, @livid
From that error it looks like you are trying to install the 18.04 swift version.
Please check the /etc/apt/sources.list.d/swiftlang-release.list.
It should read as follows.

cat /etc/apt/sources.list.d/swiftlang-release.list 
deb focal main

Any chance of using (or leveraging) for an ARMv7 Debian/Ubuntu Single Board Computer which is not a Raspberry Pi? … and, for the more recently released Swift 5.5?

Consider ARMv7 BeagleBone Black and BeagleBone AI boards with Debian 10.3 as example candidate alternates to a Raspberry Pi.

The repository supports Debian 10 buster for ARMv7 with Swift 5.1.5. This is the latest version of Swift currently available for 32bit devices.
As soon as later versions are available I will add them to the repository.

1 Like

Thanks for all your work on this, @futurejones! I’ve been working on a Vapor project with Xcode and today tried deploying it to Raspbian for the first time. Things seemed to be going along well until I ran into a mismatch between the Xcode version of Swift (5.6) and the one I installed on Debian (5.5.3). I figured if I went back to install the dev version, I'd be able to pick up 5.6. Unfortunately, it thinks I have the latest:

$ curl -s | sudo bash
running update... done.
scanning sources... done.
system detected is compatible with debian/bullseye

Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Installing debian-archive-keyring which is needed for installing 
apt-transport-https on many Debian systems.
Installing apt-transport-https... done.
Importing swiftlang gpg key... done.

--------------- Choose Swift Release Version ---------------

 If you always want to have the latest release/stable version of Swift available choose [1], if not, choose the version most suitable for your project. 
 The latest release/stable version of Swift is currently 5.5 


  1) latest/main - This will update to the latest/stable release of Swift available
  2) developer - Swift developer builds - this will update to the latest developer build available
  3) Swift version 5.4.* - this will update to the latest point/patch release of Swift 5.4
  4) Swift version 5.5.* - this will update to the latest point/patch release of Swift 5.5


Enter number [1/2/3/...] : 2

Installing the Swift developer repository

Installing /etc/apt/sources.list.d/swiftlang-release.list... done.
Running apt-get update... done.

The repository is setup!
You can now install swift using 'sudo apt install swiftlang' 

pi@furnace:~/furnace-controller $ sudo apt install swiftlang
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
swiftlang is already the newest version (5.5.3-01-debian-bullseye).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I tried sudo apt remove swiftlang and going through the script again, but it installs 5.5-01-debian-bullseye, which is even older than the 5.5.3 that was installed before.

The issue I’m running into is that the latest Xcode13.3b3 calls it @preconcurrency, but it was called @_preconcurrency before that.

Edit: Oh, I see, there aren't bullseye versions of 5.6-dev. Is that what you were talking about in the previous couple of posts?

@JetForMe, the previous posts are a different issue about armv7 versions.
Debian Bullseye was only added to the repository recently and I hadn't added any dev versions yet.
As there is no official Swift support for Debian I have to build these versions myself for the source code.
I have just built and uploaded the latest dev version for Debian Bullseye arm64 - swiftlang_5.6-2022-03-02-a-debian-bullseye_arm64.deb
This should be available when you run sudo apt update.
Let me know if there are any issues.


Once again, thanks a lot for your efforts.


@futurejones Thank you so much for that!

Cool. But how reliable is it? is producing timeouts most of the time.