我正在尝试创建一个安装 MariaDB 的配置文件,但是它一直失败。
该规定如下:
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.
似乎无法打开要求您输入密码的终端并失败。我总是可以手动安装 MariaDB,但我想通过配置文件来完成。有什么想法/建议吗?
答案1
我遇到了类似的问题。设置环境变量DEBIAN_FRONTEND=noninteractive
对我有用。
因此,对于你的情况,你需要运行(以 root 身份)
DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server