Skip to content

Conversation

@lucarin91
Copy link
Contributor

@lucarin91 lucarin91 commented Dec 4, 2025

Motivation

By default, apt-get update doesn't retunrs any error in the status code if something went wrong during repository update. We want instead to catch this error, which usually means that the board wasn't able to validate the apt repo certificates.

Change description

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@lucarin91 lucarin91 changed the title Force apt update fix: force error on apt update Dec 4, 2025
@lucarin91 lucarin91 mentioned this pull request Dec 4, 2025
5 tasks
@lucarin91 lucarin91 requested a review from a team December 4, 2025 14:48
@lucarin91
Copy link
Contributor Author

The update test was successful https://github.com/arduino/arduino-app-cli/actions/runs/19933053221

@lucarin91
Copy link
Contributor Author

test apt update command

Try an update of the apt index without a working internet connection.

before the change

arduino@pippo:~$ sudo apt update
Ign:1 https://apt-repo.arduino.cc stable InRelease
Ign:2 http://deb.debian.org/debian trixie InRelease
Ign:3 https://apt-repo.arduino.cc unstable InRelease
Ign:2 http://deb.debian.org/debian trixie InRelease
Ign:3 https://apt-repo.arduino.cc unstable InRelease
Ign:1 https://apt-repo.arduino.cc stable InRelease
Ign:1 https://apt-repo.arduino.cc stable InRelease
Ign:3 https://apt-repo.arduino.cc unstable InRelease
Ign:2 http://deb.debian.org/debian trixie InRelease
Err:3 https://apt-repo.arduino.cc unstable InRelease
  Temporary failure resolving 'apt-repo.arduino.cc'
Err:2 http://deb.debian.org/debian trixie InRelease
  Temporary failure resolving 'deb.debian.org'
Err:1 https://apt-repo.arduino.cc stable InRelease
  Temporary failure resolving 'apt-repo.arduino.cc'
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
Warning: Failed to fetch https://apt-repo.arduino.cc/dists/stable/InRelease  Temporary failure resolving 'apt-repo.arduino.cc'
Warning: Failed to fetch https://apt-repo.arduino.cc/dists/unstable/InRelease  Temporary failure resolving 'apt-repo.arduino.cc'
Warning: Failed to fetch http://deb.debian.org/debian/dists/trixie/InRelease  Temporary failure resolving 'deb.debian.org'
Warning: Some index files failed to download. They have been ignored, or old ones used instead.
arduino@pippo:~$ echo $?
0

after the change

arduino@pippo:~$ sudo apt update
Ign:1 https://apt-repo.arduino.cc stable InRelease
Ign:2 http://deb.debian.org/debian trixie InRelease
Ign:3 https://apt-repo.arduino.cc unstable InRelease
Ign:3 https://apt-repo.arduino.cc unstable InRelease
Ign:2 http://deb.debian.org/debian trixie InRelease
Ign:1 https://apt-repo.arduino.cc stable InRelease
Ign:1 https://apt-repo.arduino.cc stable InRelease
Ign:2 http://deb.debian.org/debian trixie InRelease
Ign:3 https://apt-repo.arduino.cc unstable InRelease
Err:2 http://deb.debian.org/debian trixie InRelease
  Temporary failure resolving 'deb.debian.org'
Err:3 https://apt-repo.arduino.cc unstable InRelease
  Temporary failure resolving 'apt-repo.arduino.cc'
Err:1 https://apt-repo.arduino.cc stable InRelease
  Temporary failure resolving 'apt-repo.arduino.cc'
Error: Failed to fetch https://apt-repo.arduino.cc/dists/stable/InRelease  Temporary failure resolving 'apt-repo.arduino.cc'
Error: Failed to fetch https://apt-repo.arduino.cc/dists/unstable/InRelease  Temporary failure resolving 'apt-repo.arduino.cc'
Error: Failed to fetch http://deb.debian.org/debian/dists/trixie/InRelease  Temporary failure resolving 'deb.debian.org'
Error: Some index files failed to download. They have been ignored, or old ones used instead.
arduino@pippo:~$ echo $?
100

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.

3 participants