1

I am trying to add a late_command to my preseed file but I always get errors.

This is the command I am trying to use:

in-target curl -L -o /home/$username/postinstall.sh https://raw.githubusercontent.com/netson/ubuntu-unattended/master/postinstall.sh; \
in-target chmod +x /home/$username/postinstall.sh; \
in-target /bin/sh /home/$username/postinstall.sh;

The error I get:

Execution of preseed command "in-target curl -L -o /home/$username/postinstall.sh https://raw.githubusercontent.com/netson/ubuntu-unattended/master/postinstall.sh; \
in-target chmod +x /home/$username/postinstall.sh; \
in-target /bin/sh /home/$username/postinstall.sh;" failed with exit code 127.
atwright147
  • 111
  • 1
  • 4
  • 2
    When I go to https://raw.githubusercontent.com/netson/ubuntu-unattended/master/postinstall.sh, I get a 404 error – cleary Oct 08 '18 at 21:34
  • 1
    Indeed there is no `postinstall.sh` in that repository. I suggest that you have a good look at the README of the [repository that you are trying to use](https://github.com/netson/ubuntu-unattended). – dadexix86 Oct 08 '18 at 21:39
  • 1
    If you dig a bit in the code given there, [this is the seed file that gets dowloaded](https://raw.githubusercontent.com/netson/ubuntu-unattended/master/netson.seed) – dadexix86 Oct 08 '18 at 21:40
  • @cleary ah crap. Copy / paste error -- that will be the issue. This is a fork of https://github.com/netson/ubuntu-unattended and the URL should be https://github.com/atwright147/ubuntu-unattended... – atwright147 Oct 08 '18 at 22:13

1 Answers1

2

I leave you a fully functional late_command, you can see the syntax of this:

d-i preseed/late_command string cp /cdrom/files/run.sh /target/root/; chmod +x /target/root/run.sh; in-target /bin/bash /root/run.sh; cp /cdrom/files/configs.sh /target/root/;
ICIM
  • 121
  • 4