If you’re trying to install MariaDB on Debian 13 (Trixie) and you see an error like this in your terminal:
E: The repository 'https://deb.mariadb.org/11.8/debian debian Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
…then this guide is for you.
This error usually appears when you’re using an incorrect or outdated MariaDB repository URL. In this article, I’ll walk you through how to:
- Remove the broken MariaDB repository
- Add the official, correct MariaDB repository
- Install or upgrade MariaDB cleanly on Debian 13
Why This Error Happens
If you’ve manually added a line like this to your APT sources:
deb https://mirror.mariadb.org/repo/11.8/debian debian main
APT tries to download the Release file from that URL. But MariaDB no longer serves repos in that exact structure, so the server responds with a 404 Not Found, and APT refuses to use that repository for security reasons.
That’s why you see:
E: The repository 'https://deb.mariadb.org/11.8/debian debian Release' does not have a Release file.
The solution is to remove the wrong repo URL and add the official MariaDB repo using their helper script.
Step 1: Find and Remove the Broken MariaDB Repository
First, we need to find which file contains the incorrect MariaDB repository entry.
Use this command:
grep -R "mariadb" /etc/apt/sources.list /etc/apt/sources.list.d
This will search all APT source files for the word mariadb.
You’ll likely see something like:
/etc/apt/sources.list.d/mariadb.list:deb https://mirror.mariadb.org/repo/11.8/debian debian main
Now open that file in a text editor. For example:
sudo nano /etc/apt/sources.list.d/mariadb.list
In that file, either delete the bad line or comment it out by adding a # at the beginning:
# deb https://mirror.mariadb.org/repo/11.8/debian debian main
Save and exit your editor.
Now update APT:
sudo apt update
At this point, the 404 error for the MariaDB repo should disappear, because APT is no longer trying to use that invalid URL.
Step 2: Install Prerequisites
Before we add the official MariaDB repository, make sure you have a few basic tools installed.
Run:
sudo apt update
sudo apt install -y curl gnupg lsb-release
These packages are used by the official MariaDB repo setup script to detect your OS and install the correct repository and keys.
Step 3: Add the Official MariaDB 11.8 Repository for Debian 13
MariaDB provides a script called mariadb_repo_setup that automatically:
- Detects your distribution and version
- Adds the correct repository entries
- Imports the official GPG key
To add the MariaDB 11.8 repository on Debian 13 (Trixie), run:
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- \
--mariadb-server-version="mariadb-11.8"
What this does:
- Downloads the script from
r.mariadb.com - Runs it with root privileges (via
sudo) - Tells it explicitly that you want MariaDB 11.8
Once the script finishes, update APT again:
sudo apt update
You should now see the MariaDB repository being read without any errors.
Step 4: Install MariaDB Server and Client
If MariaDB is not yet installed on your system, you can now install it normally:
sudo apt install mariadb-server mariadb-client
APT will pull MariaDB from the newly configured official repository.
After installation, you can run the security helper:
sudo mysql_secure_installation
This helps you:
- Set the root password (if needed)
- Remove anonymous users
- Disable remote root login (optional but recommended)
- Remove the test database
Step 5: Upgrade to MariaDB 11.8 (If You Already Have MariaDB Installed)
If MariaDB is already installed and you just want to upgrade to 11.8 from an older version, make sure your new 11.8 repo is correctly configured (as shown above), and then run:
sudo apt update
sudo apt full-upgrade
This will:
- Upgrade MariaDB server and client packages
- Install any required dependency updates
⚠️ Important:
Before running a full upgrade, always make a database backup:
mariadb-dump -u root -p --all-databases > /root/all-databases-backup.sql
Store this backup in a safe location so you can restore your data if something goes wrong.
Step 6: Verify the Installed MariaDB Version
After installation or upgrade, confirm that you’re running the expected version (11.8):
mariadb --version
You should see something similar to:
mariadb Ver 15.1 Distrib 11.8.0-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
You can also check from inside the MariaDB shell:
sudo mariadb
And then run:
SELECT VERSION();
Quick Troubleshooting Tips
If you still run into issues, here are a few things to check:
1. Old MariaDB Repositories Still Present
Run:
grep -R "mariadb" /etc/apt/sources.list /etc/apt/sources.list.d
Make sure there are no old lines like:
deb https://deb.mariadb.org/11.8/debian debian main
deb https://mirror.mariadb.org/repo/10.5/debian buster main
If you see them, comment them out or remove them.
2. GPG Key Problems
If you ever see an error about a missing public key or NO_PUBKEY, you can re-run the repo setup script:
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- \
--mariadb-server-version="mariadb-11.8"
This regenerates the repo configuration and re-imports the keys.
3. Network / IPv6 Issues
In rare cases, you might have IPv6 connectivity problems to the MariaDB mirror. You may see something like:
[IP: 2a01:4f8:1c17:e53d::1 443]
If your server has broken IPv6, you can temporarily disable IPv6 for APT by editing:
sudo nano /etc/apt/apt.conf.d/99force-ipv4
Add:
Acquire::ForceIPv4 "true";
Save and run:
sudo apt update
This forces APT to use IPv4 instead of IPv6.
Summary
If you see:
The repository 'https://deb.mariadb.org/11.8/debian debian Release' does not have a Release file.
on Debian 13, it means you’re using an invalid MariaDB repository URL.
The fix is:
- Remove the broken repo entry from
/etc/apt/sources.listor/etc/apt/sources.list.d/*.list - Install prerequisites:
sudo apt install -y curl gnupg lsb-release - Use the official MariaDB repo setup script:
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- \ --mariadb-server-version="mariadb-11.8" - Update and install/upgrade:
sudo apt update sudo apt install mariadb-server mariadb-client # or sudo apt full-upgrade
You now have a clean, supported MariaDB 11.8 installation on Debian 13, without any APT repository errors.
You can paste this article directly into WordPress, and use Gutenberg’s Heading, Paragraph, and Code blocks for a clean, readable technical tutorial.