Re: How to apt-get from preseed/late_command?
On Thu, Mar 01, 2007 at 03:51:55PM -0500, Joey Hess wrote:
Thanks for the answer, Joey!
> Josef Wolf wrote:
> > I'd like to "apt-get update; apt-get upgrade" from preseed/late_command
> > causing the first reboot to come up with updated kernel/modules. So I
> > put this (splitted and commented for readability) into my seed file:
> >
> > d-i preseed/late_command string \
> > cp /cdrom/preseed/postinstall.sh /target; \
> > ln -s /postinstall.sh /target/etc/rcS.d/S98postinstall; \
> > chroot /target apt-get --yes --force-yes -q update; \
> > chroot /target apt-get --yes --force-yes -q upgrade; \
> > echo press ENTER; read a
> >
> > But for some reason, apt-get just hangs. How can I find out the reason
> > why it hangs? Any ideas?
>
> Have you checked the syslog?
There's nothing suspicous in there.
> The 'read a' will certianly hang, since stdin in not connected to
> something a user can press enter at.
The "read a" is there only for debugging to give me a chance to inspect
the situation. I've checked with "ps ax" that it is _really_ apt-get
hanging.
> You might have more luck using the in-target command to run your apt-get
> in /target in an environment better tuned for package installation.
I will try that. How do I use it? Something like
in-target apt-get --yes --force-yes -q update
?
> > BTW: Is there any reason that automatic update/upgrade at the end of the
> > install is not done in the official distribution?
>
> Because an upgrade process is generally much less constrained than an
> initial install in terms of what can possibly go wrong. There can be
> config file modification prompts (due to bugs in packages mostly), and
> lots of other potential for stuff that wouldn't happen during an
> install.
Does that mean that it is a bad idea to do that from late_command?
Reply to: