
Estoy intentando instalar MySQL 8.0 en Ubuntu 18.04 automáticamente usando el script bash. Estaba configurando todas las variables que Debconf solicita, pero el mensaje aparece de todos modos. ¿Qué hay de malo en mi guión?
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
MYSQL_APT_FILE_NAME="mysql_apt_repository_tmp.deb"
echo "Installing MySQL Community Server..."
wget "https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb" -O
$MYSQL_APT_FILE_NAME &> /dev/null
if [ -z "$(ls | grep $MYSQL_APT_FILE_NAME)" ]; then
echo "ERROR: Unable to download MySQL APT repository file"
exit 0
fi
echo mysql-apt-config mysql-apt-config/repo-distro select ubuntu | debconf-set-selections
echo mysql-apt-config mysql-apt-config/repo-codename select trusty | debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-tools select Enabled | debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-preview select Disabled | debconf-set-selections
echo mysql-community-server mysql-community-server/root-pass password mystrongpassword | debconf-set-selections
echo mysql-community-server mysql-community-server/re-root-pass password mystrongpassword | debconf-set-selections
sudo dpkg -i $MYSQL_APT_FILE_NAME
Respuesta1
He resuelto este problema. Necesitaba eliminar sudo
de esta línea.
sudo dpkg -i $MYSQL_APT_FILE_NAME
y luego ejecute el script completo como sudo.