如何使用preseed删除包裹?

我正在建立一个自动化的“无问题”预制系统,并以Dustin Kirkland的服务器为例进行预测 。

他使用以下行作为自动安装的一部分安装三个包:

di pkgsel/include string byobu vim openssh-server

我正在寻找相反的,基本上能够删除包作为自动安装的一部分。

  • 我查看了安装指南
  • 我已经检查了这个预测的示例 ,但不清楚这是否是每个可用选项的规范列表。

我想我需要使用di preseed/late_command string apt-remove packagename来清理安装完成后我不想要的东西,但我不确定

在preseed配置脚本中没有清除o删除包的选项,但您可以使用此命令….

di 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 di preseed/late_command string [in-target] foo 

例子:

 di preseed/late_command string \ in-target apt-get remove packagename 

你也可以运行一个脚本:

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

或安装一组DEB文件:

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

压缩的例子只是一个例子; 它不包含所有可能的di组合,但只包含那些更常见的组合。

就个人而言,我从未试图从安装中删除软件包,因此我不确定是否有特定的di命令; 听起来你的di preseed late_command应该可行。 快速搜索文档并没有产生任何东西……但是,当然,科林会知道;-)

或者,您可以从基本服务器开始,然后添加您想要的任何内容:

 tasksel tasksel/first multiselect Basic Ubuntu server ... di preseed/late_command string apt-install whatever else