Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 14.04 uses US mirror by default #810

Closed
ravn opened this issue May 22, 2017 · 4 comments · Fixed by #838
Closed

Ubuntu 14.04 uses US mirror by default #810

ravn opened this issue May 22, 2017 · 4 comments · Fixed by #838

Comments

@ravn
Copy link

ravn commented May 22, 2017

The Ubuntu 14.04 box refers to the US archive for Ubuntu.

According to https://askubuntu.com/a/104701/963 it is possible to refer to a common archive.ubuntu.com which will then resolve:


Open your source.list using your favorite text editor, ie

sudo nano /etc/apt/sources.list

locate http://us.archive.ubuntu.com/ubuntu and replace it with http://archive.ubuntu.com/ubuntu.

Has this been considered?

@cheeseplus
Copy link
Contributor

cheeseplus commented Jun 20, 2017

It's been discussed herehttps://github.com//issues/195 - the tl;dr is that there isn't a holistic solution that works for everyone so customizing the boxes after the fact or forking the packer templates are the recommended option.

We are open to an implementation but it will need to be better than what we currently have as this is optimized for us [me] building these.

@edmorley
Copy link
Contributor

edmorley commented Jun 21, 2017

It seems that #195 discussed two different approaches:

  • Using archive.ubuntu.com instead of us.archive.ubuntu.com
  • Adding additional mirror://mirrors.ubuntu.com/mirrors.txt entries

The latter includes random third-party mirrors that from reading stack overflow seem to be less reliable, and unfortunately the discussion in #195 focused on this part, so understandably was wontfixed.

However the former maps to the more-official <country-code>.archive.ubuntu.com mirrors, that seem to have stricter reliability and freshness requirements:
https://wiki.ubuntu.com/Mirrors#Country_mirror_requirements

As such, perhaps they are more viable?

Though I wonder if this is something that should be changed upstream in the Ubuntu images themselves?

@cheeseplus
Copy link
Contributor

That's kinda the kicker that you mention, this should largely be fixed upstream ideally and as such there is a limited amount we the Bento team can do here. We're happy to update the templates to be more flexible but our hosted builds will almost definitely remain US centric for the time being.

@edmorley
Copy link
Contributor

edmorley commented Jul 4, 2017

Hmm so digging into this more, I don't think this is really an upstream issue. The us.archive.ubuntu.com URLs are not hardcoded in the installer image, but automatically set by debian-installer based on the country/locale chosen for the installation:

# Alternatively: by default, the installer uses CC.archive.ubuntu.com where
# CC is the ISO-3166-2 code for the selected country.

(See: https://help.ubuntu.com/lts/installation-guide/example-preseed.txt)

So it's really this image's choice of preseed options that are causing the US mirrors to be set instead of the generic ones that will resolve to whatever is most appropriate for the end user.

The mirror choice can be overridden via preseed (rather than having to edit /etc/apt/sources.list in the post-install scripts), and in fact this is what's already done for the Debian images:

d-i mirror/country string manual
d-i mirror/http/directory string /debian
d-i mirror/http/hostname string httpredir.debian.org
d-i mirror/http/proxy string

Also, as a point of reference, the official Ubuntu Docker images use archive.ubuntu.com too:

$ docker run -t --rm ubuntu:16.04 grep -Ev '^(#|$)' /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb http://archive.ubuntu.com/ubuntu/ xenial universe
...

As such, I think it makes sense to do this - I'll open a PR.

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 a pull request may close this issue.

3 participants