fix: skip external MariaDB repo on trixie, clean stale repo files
Some checks failed
CI / test WordOps (ubuntu-22.04) (push) Has been cancelled
CI / test WordOps (ubuntu-24.04) (push) Has been cancelled

- Trixie uses native Debian mariadb packages (external repo has no
  trixie release), so wo_mysql_repo is empty and repo add is skipped
- Clean up old openlitespeed.list and mariadb.list during install so
  they get regenerated with correct GPG keyring paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-09 11:39:33 +01:00
parent 317181e4be
commit 3585aca1ad
3 changed files with 16 additions and 5 deletions

View File

@@ -859,6 +859,10 @@ wo_init_variables
_run wo_clean_repo _run wo_clean_repo
_run wo_download_gpg_keys _run wo_download_gpg_keys
# clean up stale repo list files so they get regenerated correctly
rm -f /etc/apt/sources.list.d/openlitespeed.list 2>/dev/null
rm -f /etc/apt/sources.list.d/mariadb.list 2>/dev/null
if [ -z "$wo_force_install" ]; then if [ -z "$wo_force_install" ]; then
# check distribution support # check distribution support
wo_check_distro wo_check_distro

View File

@@ -27,8 +27,8 @@ def pre_pref(self, apt_packages):
"""Pre settings to do before installation packages""" """Pre settings to do before installation packages"""
if ("mariadb-server" in apt_packages or "mariadb-client" in apt_packages): if ("mariadb-server" in apt_packages or "mariadb-client" in apt_packages):
# add mariadb repository excepted on raspbian and ubuntu 19.04 # add mariadb repository excepted on raspbian, trixie (uses native pkgs)
if not (WOVar.wo_distro == 'raspbian'): if not (WOVar.wo_distro == 'raspbian') and WOVar.wo_mysql_repo:
Log.info(self, "Adding repository for MySQL, please wait...") Log.info(self, "Adding repository for MySQL, please wait...")
mysql_pref = ( mysql_pref = (
"Package: *\nPin: origin deb.mariadb.org" "Package: *\nPin: origin deb.mariadb.org"

View File

@@ -172,6 +172,9 @@ class WOVar():
"mariadb-common", "python3-mysqldb"] "mariadb-common", "python3-mysqldb"]
if wo_distro == 'raspbian': if wo_distro == 'raspbian':
mariadb_ver = '10.3' mariadb_ver = '10.3'
elif wo_platform_codename == 'trixie':
mariadb_ver = ''
wo_mysql = wo_mysql + ["mariadb-backup"]
else: else:
mariadb_ver = '11.4' mariadb_ver = '11.4'
wo_mysql = wo_mysql + ["mariadb-backup"] wo_mysql = wo_mysql + ["mariadb-backup"]
@@ -182,9 +185,13 @@ class WOVar():
wo_clamav = ["clamav", "clamav-freshclam"] wo_clamav = ["clamav", "clamav-freshclam"]
# APT repositories # APT repositories
wo_mysql_repo = ("deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] " if mariadb_ver:
"http://deb.mariadb.org/" wo_mysql_repo = ("deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] "
f"{mariadb_ver}/{wo_distro} {wo_platform_codename} main") "http://deb.mariadb.org/"
f"{mariadb_ver}/{wo_distro} {wo_platform_codename} main")
else:
# trixie: use native Debian mariadb packages, no external repo
wo_mysql_repo = ""
mariadb_repo_key = "https://mariadb.org/mariadb_release_signing_key.pgp" mariadb_repo_key = "https://mariadb.org/mariadb_release_signing_key.pgp"
if wo_distro == 'ubuntu': if wo_distro == 'ubuntu':
# LSPHP comes from LiteSpeed repo (same as OLS) # LSPHP comes from LiteSpeed repo (same as OLS)