Allow specifying custom Ubuntu archive mirrors in build

Bug #1818016 reported by 林博仁(Buo-ren Lin)
This bug report is a duplicate of:  Bug #1602085: Snapcraft cleanbuild --mirror. Edit Remove
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

Currently, snapcraft uses archive.ubuntu.com for the software archive and it's not optimal, please support a mechanism to do so.

## Workaround ##
Patch the source list after the build is initialized(would have to repeat it after every `snapcraft clean`)

### Multipass build ###
```
multipass exec snapcraft-my-snap-name -- sudo sed -i 's@//archive.ubuntu.com@//my.fovourite.archive.mirror@' /etc/apt/sources.list.d/default.sources
multipass exec snapcraft-my-snap-name -- sudo apt update
```

### LXD build ###
```
lxc exec snapcraft-my-snap-name -- sed -i 's@//archive.ubuntu.com@//my.fovourite.archive.mirror@' /etc/apt/sources.list.d/default.sources
lxc exec snapcraft-my-snap-name -- apt update
```

summary: - No way to directly specify local ubuntu archive mirror in multipass
- build environment
+ Allow specifying custom Ubuntu archive mirrors in build
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

I too would appreciate being able to use a custom mirror. However I'd rather not use --enable-geoip, but something which lets snapcraft use a specific mirror. For example I have a mirror at home on a specific host/IP which I'd prefer to use, to reduce my bandwidth usage, and speed up builds.

Revision history for this message
林博仁(Buo-ren Lin) (brlin) wrote :

@popey
Agreed, description fixed.

description: updated
Revision history for this message
Iain Lane (laney) wrote :

Hey, I just came here to file / look for this bug too.

I'm thinking, though, that this one is a duplicate of bug #1602085 so I'll mark it so (and copy your workaround there).

Thanks :-)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.