gpt4 book ai didi

mysql 5.7社区服务器非交互式apt安装

转载 作者:可可西里 更新时间:2023-11-01 07:12:27 42 4
gpt4 key购买 nike

我正在尝试为 ubuntu 14.04 上的非交互式 mysql 5.7 社区服务器安装创建一个 shell 调用。根据各种来源,使用 debconf-set-selections 应该允许这样的安装,但我无法启动非交互式 dpkg 安装程序。

下面是我尝试用于非交互式安装的环境变量

vagrant@default-ubuntu-1404:/sql$ echo $DEBIAN_FRONTEND 
noninteractive
vagrant@default-ubuntu-1404:/sql$ echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7 | sudo debconf-set-selections

这里是系统的所有mysql-apt-config设置

vagrant@default-ubuntu-1404:/sql$ sudo debconf-get-selections | grep mysql
mysql-apt-config mysql-apt-config/select-tools select workbench-6.2 workbench-6.3 connector-python-2.0 connector-python-2.1 router-2.0 mysql-utilities-1.5 mysql-tools
mysql-apt-config mysql-apt-config/select-preview select
mysql-apt-config mysql-apt-config/repo-distro select ubuntu
mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7
mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt/
# Choices: MySQL Server (Currently selected: mysql-5.7), MySQL Tools & Connectors (Currently selected: Enabled), MySQL Preview Packages (Currently selected: Disabled), Ok
mysql-apt-config mysql-apt-config/select-product select
mysql-apt-config mysql-apt-config/repo-codename select trusty
mysql-apt-config mysql-apt-config/unsupported-platform select abort
# Choices: mysql-5.6, mysql-5.7, None
mysql-apt-config mysql-apt-config/select-server select

以及安装本身:

wget http://dev.mysql.com/get/mysql-apt-config_0.7.2-1_all.deb
sudo dpkg -i mysql-apt-config_0.7.2-1_all.deb

以交互模式启动。

有什么想法吗?

最佳答案

如果以 root

运行,这对我有用
export DEBIAN_FRONTEND=noninteractive

debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/repo-codename select trusty'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/repo-distro select ubuntu'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt/'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-preview select '
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-product select Ok'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-server select mysql-5.7'
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-tools select '
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/unsupported-platform select abort'

wget http://dev.mysql.com/get/mysql-apt-config_0.7.2-1_all.deb
dpkg -i mysql-apt-config_0.7.2-1_all.deb
apt-get update
apt-get install -y mysql-server-5.7

关于mysql 5.7社区服务器非交互式apt安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36979574/

42 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com