Can't run setup-alpine on a machine behind a proxy
I tried to setup Alpine on a Virtualbox machine behind a corporate proxy, but couldn’t get the setup-alpine to run.
I followed the steps at https://wiki.alpinelinux.org/wiki/Alpine\_setup\_scripts :
- Insert Alpine ISO into VirtualBox machine.
- Start up Alpine, logon as root.
- Run setup-alpine.
- Follow the network setup.
- Enter the proxy address, e.g. http://10.0.2.2:3128
- (10.0.2.2 is the address of the virtualbox host, using this as the proxy works fine for wget requests other than in the setup scripts)
- When the setup-apkrepos section runs with option f - “find_fastest_mirror()”, none of the endpoints can be reached (destination unreachable)
- When the setup-disk section runs, it then quits with error:
ERROR: unsatisfiable constraints:
e2fsprogs (missing):
required by: world[e2fsprogs]
When I reviewed the script at /sbin/setup-apkrepos I found a line which actually clears the proxy setting:
find_fastest_mirror() {
export http_proxy=
I think it’s in git at: http://git.alpinelinux.org/cgit/alpine-conf/tree/setup-apkrepos.in
As a workaround, I commented out that line, then ran setup-apkrepos again, followed by setup-disk. This resolved the issue for me, and I was able to install.
I can’t think why that line would be present in the script, but there must be a reason. If there isn’t a really good reason, then that line should probably be removed, on the basis that people who have to work behind a proxy already suffer enough.
(from redmine: issue id 6219, created on 2016-09-26, closed on 2016-09-28)
- Changesets:
- Revision 380c6074 by Natanael Copa on 2016-09-27T18:36:29Z:
main/alpine-conf: dont reset http_proxy in setup-apkrepos
ref #6219
- Revision 14d3fa64 by Natanael Copa on 2016-09-27T18:46:19Z:
main/alpine-conf: dont reset http_proxy in setup-apkrepos
fixes #6219
(cherry picked from commit 380c607492fcd9f09d104653b664a26c4b048ff5)
- Revision be595d2f343ecd075a57930f475df1408a7b6b57 by Natanael Copa on 2016-11-10T10:20:39Z:
setup-apkrepos: dont reset http_proxy
it is likely needed if it is set.
ref #6219