Commit 9af1585
committed
ci(apt): unify Azure/archive fallback via mirror+file://
Previously the classic /etc/apt/sources.list (jammy) was handled by
duplicating `deb` lines with azure.archive.ubuntu.com first and
archive.ubuntu.com second. apt treats parallel deb lines as independent
sources and fetches InRelease/Packages from both, wasting ~35 MB per
update rather than falling back only when needed.
Switch both the Dockerfile and setup-universe workflow to apt's
`mirror+file://` transport:
- Write /etc/apt/ubuntu-mirrors.list with Azure first, archive second.
- Replace each `http://archive.ubuntu.com/ubuntu` reference (classic or
deb822) with `mirror+file:///etc/apt/ubuntu-mirrors.list`.
apt reads the list and tries URLs in order, using the first that
responds, so we get true first-win fallback in both sources formats.
security.ubuntu.com is left untouched (separate host, not mirrored on
Azure).
The file-existence guard uses `if [ -f "$f" ]; then ...; fi` rather
than `[ -f "$f" ] && sed ...`: under `sh -e` (the default for GHA
`run:` steps) the `&&` chain short-circuits and returns 1 when the
file doesn't exist, tripping errexit. Only one of the two sources
formats is present on any given Ubuntu version, so the non-matching
iteration would otherwise kill the step.
Verified locally by baking both the humble (jammy / classic
sources.list) and jazzy (noble / deb822) base images end to end; the
apt-get install inside the ansible rmw role succeeded via
mirror+file:// on both.
Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>1 parent 348e581 commit 9af1585
2 files changed
Lines changed: 12 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments