Skip to content

fix(ci): install snapcraft via snap instead of apt-get#206

Merged
vlasebian merged 2 commits intomasterfrom
copilot/fix-snapcraft-installation
Apr 30, 2026
Merged

fix(ci): install snapcraft via snap instead of apt-get#206
vlasebian merged 2 commits intomasterfrom
copilot/fix-snapcraft-installation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 30, 2026

snapcraft is no longer available as an apt package on ubuntu-latest runners, causing the "Tag release" workflow to fail with E: Unable to locate package snapcraft.

Change

  • .github/workflows/release.yaml: Replace the broken apt-based install with the officially supported snap install:
- run: sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
+ run: sudo snap install snapcraft --classic
Original prompt

The "Tag release" workflow (.github/workflows/release.yaml) is failing at the "Install Snapcraft" step because snapcraft is no longer available as an apt package on the ubuntu-latest runner image.

Error from the job logs:

E: Unable to locate package snapcraft

Fix: On line 17 of .github/workflows/release.yaml, replace:

run: sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft

with:

run: sudo snap install snapcraft --classic

Snapcraft is distributed as a snap package and should be installed via snap install rather than apt-get.

Failing job: https://github.com/TheThingsNetwork/lorawan-stack-migrate/actions/runs/25159176115/job/73748767307

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant:

Failing Job Analysis

The job fails at the "Install Snapcraft" step because the snapcraft package is not available via apt-get on the ubuntu-latest runner image:

E: Unable to locate package snapcraft

Snapcraft is distributed as a snap, not as a deb package, so apt-get install snapcraft no longer works on newer Ubuntu runner images.

Solution

Replace the apt-get install step with a snap-based installation using the dedicated snapcore/action-build action, or simply install it via snap. Here's the minimal fix in .github/workflows/release.yaml:

     - name: Install Snapcraft
-      run: sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
+      run: sudo snap install snapcraft --classic

This installs Snapcraft via its officially supported distribution method (snap) and should resolve the failure.

User: Open a PR for this.

Assistant: I've kicked off the coding agent to create a PR that replaces sudo apt-get install snapcraft with sudo snap install snapcraft --classic in the release workflow. You'll be prompted to confirm once the PR is ready.

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Fix Snapcraft installation in release workflow fix(ci): install snapcraft via snap instead of apt-get Apr 30, 2026
Copilot AI requested a review from vlasebian April 30, 2026 10:52
@vlasebian vlasebian marked this pull request as ready for review April 30, 2026 10:54
@vlasebian vlasebian requested a review from happyRip as a code owner April 30, 2026 10:54
@vlasebian vlasebian merged commit b0793d8 into master Apr 30, 2026
1 check passed
@vlasebian vlasebian deleted the copilot/fix-snapcraft-installation branch April 30, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants