有没有办法在dpkg -i中传递参数,然后可以在preinst和postinst中使用这些参数?我已经研究过了,想知道是否可以用$1或$2来引用这些参数。谢谢。
$ VARIABLE=foo dpkg --install package.deb
你知道,通过使用debconf-get-selections
命令,可以查看应用程序的参数。例如:debconf-get-selections | grep myapp
假设有两个参数可用于你的deb软件包,因此你可以执行非交互式安装,如下所示:
echo myapp myapp/param1 string 8888 | debconf-set-selections
echo myapp myapp/param2 boolean true | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg -i blablabla.deb