6

Using Lucid, installing from the Lucid mini.iso. Both AMD64.

In the following I've tried as \, all of apt-get, apt-install, anna-install, dpkg:

d-i preseed/early_command string <cmd+opt> squid-deb-proxy-client

I've also tried:

d-i preseed/early_command string /usr/bin/wget \
    -O squid-deb-proxy-client_0.3.1_all.deb \
    http://ubuntu.media.mit.edu/ubuntu//pool/universe/s/squid-deb-proxy/squid-deb-proxy-client_0.3.1_all.deb && dpkg -i squid-deb-proxy-client_0.3.1_all.deb

Is this possible, and if nor what is the earliest point one can get a installation to use the squid-deb-proxy server?

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
hedgehog
  • 167
  • 1
  • 11
  • 2
    Is there a reason you don't want to do this via "d-i pkgsel/include"? – Pete Ashdown May 16 '11 at 22:27
  • No. that is what I have now. I was just wondering if it is possible to get this set up as early as possible. Does using `d-i pkgsel/include ....` mean that all package downloads will go though the proxy? – hedgehog May 25 '11 at 00:48
  • 1
    Unless I'm not understanding you correctly, if all you want is your downloads to go through a proxy, you should use "d-i mirror/http/proxy string". If you want it to go through a proxy on the same box you're installing, that would be much more difficult, but I don't understand why you'd want to do that in the first place. – Pete Ashdown Jun 07 '11 at 14:42
  • Pete the box is actually a VM which boots itself several times _and_ has several children (which boot themselves several times too) all do an apt update several times. The idea was to have all these VM's only grab the packages _once_. – hedgehog Apr 26 '12 at 08:01
  • @PeteAshdown you're misunderstanding that it's about the convenience of not having to know the proxy's URL. – Frederick Nord May 27 '16 at 17:31

4 Answers4

4

To force the installer to use your proxy server, configure it using preseeding properly using the d-i mirror/http/proxy option, e.g.:

d-i mirror/http/proxy string http://ip-or-hostname-of-proxy:8000/

You don't really need the squid-deb-proxy-client package to use the Squid proxy. The only purpose of the -client package is that it can auto-discover the proxy servers in the network.

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
gertvdijk
  • 67,007
  • 33
  • 188
  • 283
3

When the early_command runs, I don't think you even have /target already formatted/mounted. For instance, preseed/early_command can be used to install udebs (but note, not standard debs) in the installer environment:

# This first command is run as early as possible, just after
# preseeding is read.
#d-i preseed/early_command string anna-install some-udeb

You can run this in your late_command, that's when you can actually install stuff in the target system:

d-i preseed/late_command string \
in-target apt-get install -y --force-yes openssh-server; \
true

I think the best way to have your system get packages from a proxy is what Pete Ashdown suggested.

roadmr
  • 33,892
  • 9
  • 80
  • 93
  • "I think the best way to have your system get packages from a proxy is what Pete Ashdown suggested." the problem is that it's not as convenient because you have to know the proxy's URL. With the squid-deb-proxy-client package, you don't. – Frederick Nord May 27 '16 at 17:30
1

It's currently not possible due to bug #1183326, however if one day it gets fixed it should be possible with:

d-i anna/choose_modules string squid-deb-proxy-client-udeb

In your preseed file, the d-i mirror/http/proxy trick will work on limited escenarios due to bug #642159

Javier López
  • 1,436
  • 2
  • 19
  • 29
  • why `choose_modules`? I would expect that it's necessary to tell it where to get the modules from, e.g. to `anna-install /path/to/udeb`. – Frederick Nord May 28 '16 at 15:31
0

You can use a post install bash script to install packages, below is the preseed/late_command:

d-i preseed/late_command string \
    cp /cdrom/post_install.sh /target/root/; \
    chroot /target chmod +x /root/post_install.sh; \
    chroot /target bash /root/post_install.sh

post_install.sh:

#!/bin/sh

apt-get install -y --force-yes \
    git \
    python-pip \
    ansible
feroz
  • 1