我正在使用以下命令在ubuntu 14.04上静默安装Maria DB。
export DEBIAN_FRONTEND=noninteractive
sudo debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password password PASS'
sudo debconf-set-selections <<< 'mariadb-server-10.0 mysql-server/root_password_again password PASS'
sudo apt-get install -y mariadb-server
但它总是在窗口中提示以下内容
────────────────────┤ Configuring mariadb-server-5.5 ├────────────────────┐ │ │ │ MariaDB is a drop-in replacement for MySQL. It will use your current │ │ configuration file (my.cnf) and current databases. │ │ │ │ Note that MariaDB has some enhanced features, which do not exist in │ │ MySQL and thus migration back to MySQL might not always work, at least │ │ not as automatically as migrating from MySQL to MariaDB. │ │ │ │ Really migrate to MariaDB? │ │ │ │ [Yes] [No] │
在这方面有人能帮助我吗?
答案 0 :(得分:0)
我有类似的问题,我试图为vagrant创建一个配置脚本来安装和配置MariaDB,解决问题我将变量 DEBIAN_FRONTEND 设置为非交互式并使用sudo的-E选项[1]加载所有现有变量:
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get install -y mariadb-server
[1]
-E, - pre-env
向安全策略指示用户希望保留其现有环境变量。安全政策可能会返回 如果用户没有权限保留,则会出错 环境。