New Swift Package Repository for Ubuntu/Debian Linux Distributions

I have a POWER9 ppc64le machine running Ubuntu 20.04.
Is it possible to add swift ppcle64 to your apt repo?

@BracketMaster, I don't think Swift is available for ubuntu/20.04/ppc64le, but if somebody can supply a compatible toolchain, I can package it and add it to the repository.

Respostory Update

New Developer Snapshots.

Swift 5.6 has arrived!
The developer snapshots have been updated to 2021-07-30-a

Swift version 5.6-dev (LLVM ba0b85f590c1ba2, Swift b8d2f269cb060ad)
Target: x86_64-unknown-linux-gnu

Fix for lld Conflict

All the 5.4.2 packages have been rebuild with fix for lld conflict.
The new packages have an iteration number of 02 and will be available after running sudo apt update.

# example
# old package
swiftlang_5.4.2-01-ubuntu-focal_amd64.deb

# new package
swiftlang_5.4.2-02-ubuntu-focal_amd64.deb
1 Like

amd64 for Debian Buster - is it coming back to your repository?

@aatv , there aren't any Swift builds available for amd64 Debian Buster at the moment. There is a bug in binutils that is causing the builds to fail. I hope to have this fixed soon and amd64 packages available sometime this week.

Repository Update

New Install Script

I have created a new install script to allow easy selection of repository sections.
When running the install script you will now get a menu where you can select which repository section to install.


----- Choose Swift Release Type -----
  1) stable - Swift version 5.3.3
  2) latest - Swift version 5.4.* - this will update to the latest release version available
  3) development - Swift developer builds - this will update to the latest developer build available

Enter number [1/2/3] : 3

Installing Swift developer repository

Importing swiftlang gpg key... done.
Running apt-get update... done.

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

New 'stable' Repository Section

The stable section allows you to install swift and not worry about the swift version changing when running apt upgrade. This is currently set at swift-5.3.3-release but can be changed to what ever the agreed stable version should be.

New Packages for Debian 10 buster - x86_64/amd64

There are now packages available for x86 Debian 10.
These include 5.3.3 , 5.4.2 and the latest developer snapshots.

Update to Ubuntu 21.04 Hirsute x86_64/amd64 Packages.

The work around to enable the install of libpython3.8 is now built into the installer script.
The /etc/apt/sources.list.d/swiftlang-release.list now includes groovy main.

deb https://archive.swiftlang.xyz/ubuntu/ hirsute main dev
deb https://swiftlang.xyz/ubuntu/ hirsute main dev
deb http://archive.ubuntu.com/ubuntu/ groovy main restricted

This allows libpython3.8 to be installed as a dependent with the Swift install without any extra work.

New Developer Snapshots

Swift 5.6 developer snapshots are now available in arm64 and amd64 in the following -

  • Debian 10 buster
  • Ubuntu 18.04 bionic
  • Ubuntu 20.04 focal
  • Ubuntu 21.04 hirsute
3 Likes

Debian 11 Bullseye Now Available

Debian 11 bullseye has been added to the repository with the following packages available.

  • swift-5.4.2-RELEASE for arm64 and amd64
  • swift-DEVELOPMENT-SNAPSHOT-2021-08-13-a for arm64 and amd64

How to add the repository using the quick install script.

# run update and install curl
sudo apt update && sudo apt install curl

# run repository install script
curl -s https://swiftlang.xyz/install.sh | sudo bash

# install swift
sudo apt install swiftlang
1 Like

Repository Update

Improvements to Install Script

The install script now supports most Ubuntu/Debian based distributions.
You can now install Swift on distributions such as -

  • Ubuntu
  • Debian
  • Linux Mint
  • Elementary OS
  • Lubuntu
  • Raspbian
  • and many more.

Ubuntu 21.04 Hirsute amd64 / x86_64

The Ubuntu 21.04 Hirsute amd64 / x86_64 packages are now natively built on ubuntu 21.04 and are compatible with the default python3.9 install. The work around to enable the install of libpython3.8 is no longer needed.

Developer Snapshots Updated

The developer snapshots have been updated to swift-DEVELOPMENT-SNAPSHOT-2021-08-25-a swift-DEVELOPMENT-SNAPSHOT-2021-08-30-a

7 Likes

Repository Update

Bug Fix

Fixed the following sudo apt update error with with dual arch installations with x86_64 and i386.

N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository doesn't support architecture 'i386'

Developer Snapshots Updated.

The developer snapshots have been updated to swift-DEVELOPMENT-SNAPSHOT-2021-09-07-a

Zorin OS

Swift install tested and confirmed on Zorin OS

3 Likes

@futurejones The website appears to be down?

@svanimpe It should be ok now, had some power supply issues to the server.

Thanks! I look forward to trying it out.

Swift on Linux really needs more official native packages and easier installation. Maybe RPM and Debs for Swift: Call for the Community - #36 by mishal_shah is a first step?

1 Like

Thanks for the link in Bugs @svanimpe.

Thanks for the repo. I think a link from the website to this thread would help those (like me) who found the website before the thread and wanted to confirm who the author is before sudo piping it to bash.

I'm going to try this out now, one week before breaking it with the 21.10 beta because I also really want horizontal workspaces.

@futurejones I'm looking into adopting this repository for GitHub - pwsacademy/swift-setup: Student-friendly setup instructions for platforms, editors, and IDEs that support Swift..

I'm just wondering what's the average delay between a release on Swift.org and this repository? And what about new Ubuntu releases (21.10 for example)?

Thanks!

New Swift version release time.

@svanimpe The time from official release to upload to the repository should only be a few days. This will vary depending on which version of Debian or Ubuntu you are using.
At the moment, up to and including swift 5.5, Swift.org only has releases for Ubuntu 18.04 and 20.04 and in x86_64(amd64) versions only.
All the other releases in the repository I have to build myself from the source code.
Arm64/Aarch64 versions are fairly straight forward as I already the hardware infrastructure and a Jenkins build CI setup.
For the Debian 10 /11 and Ubuntu 21.04 / 21.10 x86_64 versions I have to spin up some AWS servers for the builds.

New Ubuntu / Debian Releases

I will be adding the new Ubuntu / Debian releases to the repository as soon as possible after they are released.
Ubuntu Impish 21.10 has already been added.
The actual release time will depend whether swift is compatible with the new release.
For example adding Ubuntu Hirsute took a bit of time because a new Hirsute CI build system was required.
Adding Ubuntu Impish was quick and easy because the existing Hirsute builds run without modification on Impish.

Repository Restructuring.

I am in the process of restructuring the repository sections to provide better control of which Swift version is installed.
At the moment the repository has 3 sections -

  • stable
    This was set at 5.3.3
  • main
    This contains the latest official swift release version (was 5.4.3)
  • dev
    This contains developer snapshots.

The concept of a 'stable' version sort of worked until 5.5 was released. This means if we update 'main' to 5.5 then 5.4.3 is no longer available. This can be fixed by updating 'stable' to 5.4 but then 5.3 is not available. In short the idea of a 'stable' version just doesn't work.

Because of the incompatibly between different versions of swift the concept of just a 'main' section containing the latest version of swift does not work either.

The solution I have come up with is that the repository will have sections corresponding to the release versions of swift. The sections will be as follows -

  • v5_3
    This will contain the latest point release of 5.3
  • v5_4
    This will contain the latest point release of 5.4
  • v5_5
    This will contain the latest point release of 5.5
  • main
    This will contain the latest release of swift
  • dev
    This contains developer snapshots.

As new versions of swift are released 5.6, 6.0 etc, new sections will be added to the repository.
This means you be able to choose the latest version of swift or a specific version required for your project.

There will be a new quick install script to allow the easy selection of the different swift versions.

I hope to have all these changes completed in the next few days.

4 Likes

Repository Update.

There have been some major updates and restructuring of the repository.
Over the last couple of months I have been working on a number of different aspects of the repository to find the best and most suitable structure for ease of use and flexibility.
As mentioned in the above post the repository sections needed to be changed to allow install of different versions of Swift.
All changes needed have now been completed and I am happy that the repository is now stable and I will be committing to maintain and update the repository as needed for at least the next 12 months and hopefully much longer.
Repository updates and changes are as follows -

Repository Name

The new repository name will be the "Swift Community Apt Repository".

Repository URL

The main repository url is now "https://archive.swiftlang.xyz".

Repository Hosting

The repository was being hosted on one of my homelab servers. I have now moved the main repository to a cloud server for better network reliability and bandwidth.

Website URL

The url "https://swiftlang.xyz" is now an information website about the repository.
The website contains a quick start guide and a full user guide.
The user guide contains information about supported distributions, repository installation and usage.
There are also links to direct browsing of the repository files and getting help.

Repository Install Script.

The install script has been updated with a new menu to allow the choice which swift version is installed.

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

 If you want the latest Swift release choose [1], if not, choose the version most suitable for your project. 

---------------------------------------------------------

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

---------------------------------------------------------

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

The quick install script is now located at the new url - "https://archive.swiftlang.xyz/install.sh".
The full code of the install script is available at - https://gist.github.com/futurejones/swift-apt-repo-install.sh

Next Steps

I am currently working on containerizing a repository mirror so regional mirrors can be setup quickly and easily using Docker.

5 Likes

Nice work. It worked flawlessly on 21.10 last I tried (once I remembered to update the install script).

This might sound stupid, but, since option 1 did not mention "stable" (or similar) I felt more comfortable selecting 5 manually, especially after being reminded of the "developer" versions :slightly_smiling_face:

Edit: I guess it says "release", but I didn't think of it that way...

@Andreas

Thanks for the feedback, I will update the menu with a better explanation about option 1 and what the current latest release version is.
Essentially at the moment option 1 and 5 are the same. They will remain the same up until version 5.6 is released. Then (1) latest/main will move to 5.6.

I have updated the install script menu to make the version choices a bit clearer.

--------------- 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 release/stable version of Swift available
  2) developer - Swift developer builds - this will update to the latest developer build available
  3) Swift version 5.3.* - this will update to the latest point/patch release of Swift 5.3
  4) Swift version 5.4.* - this will update to the latest point/patch release of Swift 5.4
  5) Swift version 5.5.* - this will update to the latest point/patch release of Swift 5.5

---------------------------------------------------------

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

Developer Snapshots

The developer snapshots have all been updated to 2021-10-18-a

Terms of Service

Privacy Policy

Cookie Policy