Friday, April 19, 2024
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 9969  / 1 Year ago, sat, april 29, 2023, 8:16:57

I'm setting up an automated "no questions asked" preseed system and using Dustin Kirkland's server preseed as an example.



He uses the following line to install three packages as part of the automated install:



d-i pkgsel/include string byobu vim openssh-server



I am looking for the inverse of this, basically be able to remove packages as part of the automated install.





I am thinking I need to to use d-i preseed/late_command string apt-remove packagename to clean up stuff I don't want when the install is done, but I am not sure


More From » installation

 Answers
2

There isn't an option to purge o delete a package in the preseed configuration script but you can use this command....



d-i preseed/late_command



This command is run just before the install finishes, but when there is
still a usable /target directory. You can chroot to /target and use it
directly, or use the apt-install and in-target commands to easily install
packages and run commands in the target system.
"in-target" means: chroot /target
d-i preseed/late_command string [in-target] foo


example :



d-i preseed/late_command string 
in-target apt-get remove packagename


you can also run a script :



d-i preseed/late_command string 
in-target wget http://........./postinst.sh -O /root/postinst.sh;
in-target /bin/bash /root/postinst.sh


or install a group of DEB files :



d-i preseed/late_command               string 
for deb in /hd-media/*.deb; do cp $deb /target/tmp;
chroot /target dpkg -i /tmp/$(basename $deb); done

[#44082] Sunday, April 30, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
erranbe

Total Points: 118
Total Questions: 95
Total Answers: 117

Location: Virgin Islands (U.S.)
Member since Tue, Jul 7, 2020
4 Years ago
erranbe questions
;