我正在尝试创build一个安装MariaDB的configuration文件,但它一直失败。
规定如下所示:
sudo apt-get install -y software-properties-common sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db sudo add-apt-repository 'deb http://ftp.cc.uoc.gr/mirrors/mariadb/repo/10.0/ubuntu trusty main' apt-get update -y apt-get install -y mariadb-server
而我得到的错误是:
==> default: Preparing to unpack .../mariadb-server-10.0_10.0.17+maria-1~trusty_amd64.deb ... ==> default: (B)00 [BLANK SPACES HERE] ==> default: Package configuration??????????????????????????????????????????????????????????????? Configuring mariadb-server-10.0 ?????????????????????????????????????????????????????????????????? While not mandatory, it is highly recommended that you set a password ?????? for the MariaDB administrative "root" user.???????????? If this field is left blank, the password will not be changed.???????????? New password for the MariaDB "root" user:???????????? _______________________________________________________________________ ????????????<Ok>??? ==> default: Failed to open terminal.debconf: whiptail output the above errors, giving up! ==> default: dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.0_10.0.17+maria-1~trusty_amd64.deb (--unpack): ==> default: subprocess new pre-installation script returned error exit status 255 ==> default: Selecting previously unselected package libhtml-template-perl. ==> default: Preparing to unpack .../libhtml-template-perl_2.95-1_all.deb ... ==> default: Unpacking libhtml-template-perl (2.95-1) ... ==> default: Selecting previously unselected package mariadb-server. ==> default: Preparing to unpack .../mariadb-server_10.0.17+maria-1~trusty_all.deb ... ==> default: Unpacking mariadb-server (10.0.17+maria-1~trusty) ... ==> default: Processing triggers for man-db (2.6.7.1-1) ... ==> default: Errors were encountered while processing: ==> default: /var/cache/apt/archives/mariadb-server-10.0_10.0.17+maria-1~trusty_amd64.deb ==> default: E ==> default: : ==> default: Sub-process /usr/bin/dpkg returned an error code (1) ==> default: Reading package lists... ==> default: Building dependency tree... ==> default: Reading state information... ==> default: You might want to run 'apt-get -f install' to correct these. ==> default: The following packages have unmet dependencies: ==> default: mariadb-server : Depends: mariadb-server-10.0 (= 10.0.17+maria-1~trusty) but it is not installed ==> default: E ==> default: : ==> default: Unmet dependencies. Try using -f.
它似乎无法打开terminal,要求您input密码,并失败。 我总是可以手动安装MariaDB,但是我想通过configuration文件来完成。 任何想法/build议?
我有一个类似的问题。 设置环境variablesDEBIAN_FRONTEND=noninteractive为我工作。
所以在你的情况下,你需要运行(以root身份)
DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server