如何在 debian preseed 文件中将命令组合在一起?

Nic*_* P. 5 linux debian

我想知道是否可以在 preseed 文件中将命令组合在一起。

就像是:

d-i preseed/late_command string yes N | apt-get install package -y
Run Code Online (Sandbox Code Playgroud)

(我意识到这是一个有点糟糕的例子。我只是想知道它是否/如何工作。)

ase*_*seq 12

我在最后阶段这样做了,以下是一些示例,可以让您了解:

d-i preseed/late_command string \
cd /target/etc/apt/; \
wget http://repo.example.com/sources_new.list; \
mv sources_new.list sources.list; \
echo 'Acquire::http::Proxy "http://proxy.example.org";' >> apt.conf; \
ls . > temp; \
cat temp | grep -cq string; \
cd /; \
in-target apt-get update; \
in-target apt-get -y upgrade; \
in-target apt-get -y dist-upgrade; \
in-target tasksel install desktop; \
in-target apt-get -y install sudo \
less \
ssh \
icedove \
lynx \
xscreensaver;
Run Code Online (Sandbox Code Playgroud)

因此,默认情况下目标文件系统位于 /target ,您可以四处移动,复制和删除文件,编辑文件,如果要在目标文件系统中运行命令,请在命令前使用“in-target”。

有关更多文档,请参阅:http : //di.alioth.debian.org/manual/en.amd64/apbs05.html#preseed-hooks