Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debootstrap through authenticated proxy

I am to install debian on my PC by 'from other linux' method and I run into problem with debootsrapt not being able to go through our proxy. As I understand the debootstrap doesnt have config file neither takes arguments on command line (relating to proxy), so I set following two environment variables:

ftp_proxy=http://myname:[email protected]:4128
http_proxy=http://myname:[email protected]:4128

Still I am getting:

# /usr/sbin/debootstrap --arch i386 wheezy /mnt/debinst http://ftp.cz.debian.org/debian
I: Retrieving Release
E: Failed getting release file http://ftp.cz.debian.org/debian/dists/wheezy/Release

the Release file can be get via browser, so it exists and so on...

I wonder if this can be done at all

Thanks

like image 528
user2389519 Avatar asked Feb 17 '23 05:02

user2389519


2 Answers

Well, I am to answer my question by myself.

With strace I found that debootstrap calls wget to fetch files from repositories. Obviously environment variables were somehow ignored but I edited /etc/wgetrc and put there all proxy related settings.

So it works.

BTW: debootstrap itself is just a script so maybe other workarounds would be possible.

like image 181
user2389519 Avatar answered Feb 18 '23 17:02

user2389519


You need to export the environment variables after setting them.

# ftp_proxy=http://myname:[email protected]:4128
# http_proxy=http://myname:[email protected]:4128
# export ftp_proxy http_proxy
# /usr/sbin/debootstrap --arch i386 wheezy /mnt/debinst http://ftp.cz.debian.org/debian

Also, if you try to set them from a user shell and then use sudo to run debootstrap, those variables may not pass through so it's better to set them after getting to a root shell.

like image 26
penguin359 Avatar answered Feb 18 '23 17:02

penguin359