Improve MySQL setup for Debian Trixie compatibility
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled

Refactored MySQL installation logic to use Bookworm packages for Debian testing/unstable (Trixie, Forky, Sid) instead of blocking installation. Added conditional purge of MySQL packages only if installed and improved messaging for unsupported distributions.
This commit is contained in:
CanbiZ 2025-10-21 10:00:06 +02:00
parent 915e2d4f58
commit dbbf14f22a

View File

@ -2305,35 +2305,33 @@ function setup_mysql() {
fi fi
if [[ "$NEED_INSTALL" == true ]]; then if [[ "$NEED_INSTALL" == true ]]; then
$STD systemctl stop mysql || true
$STD apt purge -y "^mysql-server.*" "^mysql-client.*" "^mysql-common.*" || true
# Cleanup old repository files # Cleanup old repository files
cleanup_old_repo_files "mysql" cleanup_old_repo_files "mysql"
# MySQL compatibility check for Debian Trixie # MySQL compatibility check for Debian Trixie - use Bookworm packages
local SUITE
if [[ "$DISTRO_ID" == "debian" && "$DISTRO_CODENAME" =~ ^(trixie|forky|sid)$ ]]; then if [[ "$DISTRO_ID" == "debian" && "$DISTRO_CODENAME" =~ ^(trixie|forky|sid)$ ]]; then
msg_error "MySQL is not compatible with Debian testing/unstable (${DISTRO_CODENAME})" msg_warn "MySQL not officially supported on Debian testing/unstable - using Bookworm packages"
msg_info "Reason: MySQL packages depend on libaio1, but Debian Trixie uses libaio1t64" SUITE="bookworm"
msg_info "" else
msg_info "Alternative solutions:" case "$DISTRO_CODENAME" in
msg_info " 1. Use MariaDB instead: MARIADB_VERSION=\"11.4\" setup_mariadb" bookworm | bullseye)
msg_info " 2. Wait for Oracle to update MySQL packages for Debian 13" SUITE="$DISTRO_CODENAME"
msg_info " 3. Use Debian 12 (Bookworm) which is officially supported" ;;
return 1 *)
# For Ubuntu
SUITE=$(get_fallback_suite "$DISTRO_ID" "$DISTRO_CODENAME" "https://repo.mysql.com/apt/${DISTRO_ID}")
;;
esac
fi fi
# MySQL doesn't support Debian testing/unstable - try bookworm as fallback # Stop existing MySQL if running
local SUITE $STD systemctl stop mysql 2>/dev/null || true
case "$DISTRO_CODENAME" in
bookworm | bullseye) # Only purge if MySQL is actually installed
SUITE="$DISTRO_CODENAME" if dpkg -l | grep -q "^ii.*mysql-server"; then
;; $STD apt purge -y mysql-server* mysql-client* mysql-common 2>/dev/null || true
*) fi
# For Ubuntu
SUITE=$(get_fallback_suite "$DISTRO_ID" "$DISTRO_CODENAME" "https://repo.mysql.com/apt/${DISTRO_ID}")
;;
esac
# Use standardized repo setup # Use standardized repo setup
setup_deb822_repo \ setup_deb822_repo \