我正在尝试创建一个脚本来自动安装 LAMP 服务器,并且在 debian 中无人值守。
问题是我意识到 debconf-set-selections 似乎不适用于 phpmyadmin。
事实上,如果我跑..
debconf-get-selections | grep phpmyadmin
..它不返回任何东西,它应该返回您可以选择和使用的可用选项。
是否有可能在 debconf 的最新版本中 phpmyadmin 不可用?
这是我的代码,它什么也不做。我的意思是,它仍然要求选项:
def installPHPMyAdmin():
subprocess.call("debconf-set-selections <<< " +
"\"phpmyadmin phpmyadmin/dbconfig-install boolean true\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/mysql/admin-pass " +
"password " + mysqlPass + "\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/mysql/app-pass " +
"password " + phpMyAdminPass + "\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/app-password-confirm " +
"password " + phpMyAdminPass + "\"")
subprocess.call("debconf-set-selections <<< \"phpmyadmin phpmyadmin/reconfigure-webserver " +
"multiselect none\"")
return subprocess.call("apt-get install -y phpmyadmin")