Attempts to install MariaDB-Server and Client are failing in Debian 12

Joined
Nov 7, 2023
Messages
63
Reaction score
11
Credits
904
Attempting to install mariadb-server - but continually experiencing issues:
****************************************************************************************
XXXXXXXX@XXXXXXXXX:~$ sudo apt install mariadb-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
mariadb-test
The following NEW packages will be installed:
mariadb-server
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
19 not fully installed or removed.
Need to get 0 B/3,655 kB of archives.
After this operation, 55.2 MB of additional disk space will be used.
Retrieving bug reports... 0% Fail
Error retrieving bug reports from the server with the following error message:
E: getaddrinfo: Name or service not known (bugs.debian.org:80)
It appears that your network connection is down. Check network configuration and try again
Retry downloading bug information? [Y/n] y
One package at a time? [Y/n] n
One bug report at a time? [Y/n] n
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
Preconfiguring packages ...
(Reading database ... 405556 files and directories currently installed.)
Preparing to unpack .../mariadb-server_1%3a10.11.6-0+deb12u1_amd64.deb ...
Failed to stop mariadb.service: Unit mariadb.service not loaded.
invoke-rc.d: initscript mariadb, action "stop" failed.
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Attempt to stop MariaDB/MySQL server returned exitcode 5
There is a MariaDB/MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
dpkg: error processing archive /var/cache/apt/archives/mariadb-server_1%3a10.11.6-0+deb12u1
_amd64.deb (--unpack):
new mariadb-server package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server_1%3a10.11.6-0+deb12u1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
****************************************************************************************

I checked information in dmesg but haven't been able to make sense of the readout, as I am receiving the wrong date being given on the readout (namely, the dmesg is showing readings of Mar 7 - while the date readouts below show the current local and UTC readouts:

$ date -u
Wed Mar 6 07:24:54 PM UTC 2024

$ date
Wed Mar 6 11:32:49 AM PST 2024


I've attempted to remove any traces of mariadb services - but, while the system claims that there are components that are installed, there are services that I can delete or remove:


I attempted to perform an autopurge - but that doesn't seem to have resolved the issue. I am currently in a state where I can't remove MariaDB, as the system claims that it isn't installed - but then, I can't work with whatever remnants that have been installed.

I'm not sure how to proceed from here.

MY DESIRED OUTCOME: I'm wanting to install both mariadb-server, mariadb-client, and all dependencies associated with the two, in order to work with databases.


Laptop Information:

,g$$$$$$$$$$$$$$$P. ------------------------
,g$$P" """Y$$.". OS: Debian GNU/Linux 12 (bookworm) x86_64
,$$P' `$$$. Host: 82XF IdeaPad Slim 5 16IRL8
',$$P ,ggs. `$$b: Kernel: 6.5.0-0.deb12.4-amd64
`d$$' ,$P"' . $$$ Uptime: 3 days, 16 hours, 58 mins
$$P d$' , $$P Packages: 3378 (dpkg)
$$: $$. - ,d$$' Shell: bash 5.2.15
$$; Y$b._ _,d$P' Resolution: 1920x1200
Y$$. ."Y$$$$P"' DE: Plasma 5.27.5
`$$b "-.__ WM: KWin
`Y$$ Theme: [Plasma], Breeze [GTK2/3]
`Y$$. Icons: [Plasma], breeze [GTK2/3]
`$$b. Terminal: konsole
`Y$$b. CPU: 13th Gen Intel i7-1355U (12) @ 5.000GHz
`"Y$b._ GPU: Intel Raptor Lake-P [Iris Xe Graphics]
`""" Memory: 9198MiB / 15713MiB
 

Attachments

  • dmesg_loginname_removed.txt
    129.4 KB · Views: 50
  • MariaDB_Installation_Attempt_Error_Message.jpg
    MariaDB_Installation_Attempt_Error_Message.jpg
    304.3 KB · Views: 57
  • autopurge.txt
    145 bytes · Views: 32
Last edited:


Unfortunately, this also seems to be preventing me from installing other applications: can't install rclone, as the system keeps wanting to install mariadb - even though mariadb isn't listed as one of rclone's dependencies.


Checked online. The only information came from this site:
1) sudo apt-get remove --purge mariadb-server mariadb-client
2) sudo apt-get autoremove
3) sudo apt-get autoclean
4) sudo apt-get install mariadb-server mariadb-client

However, I am still experiencing the issue with mariadb.

REFERENCE: https://mariadb.com/kb/en/mariadb-installation-dependancy-problems-and-failed-to-start-service/
 

Attachments

  • rclone_info.txt
    5.5 KB · Views: 49
Hello, please share output of the following commands:

cat /etc/apt/sources.list

apt-cache policy | sed -n 's/.*o=\([^,]\+\).*/\1/p' | uniq

apt-cache policy mariadb-server
 
cat /etc/apt/sources.list
****************************************************

$ cat /etc/apt/sources.list
# deb cdrom:[Debian GNU/Linux 12.2.0 Bookworm - Official amd64 DVD Binary-1 with firmware 20231
007-10:29]/ bookworm main non-free-firmware

####FTP Site ####
deb https://ftp.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src https://ftp.debian.org/debian bookworm main contrib non-free non-free-firmware


deb http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware


# deb http://deb.debian.org/debian-security bookworm-security main contrib non-free non-free-firm
ware
# deb-src http://deb/debian/org/debian-security bookworm-security main contrib non-free non-free-
firmware


deb http://security.debian.org/debian-security bookworm-security main non-free non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free non-free-firmw
are

####BACKPORTS####

# deb http://deb.debian.org/debian/ bookworm-backports main contrib
# deb-src http://deb.debian.org/debian backports main contrib

deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware


####IGNORE THESE****
#deb http://deb.debian.org/debian/ bookworm-updates main non-free non-free-firmware
#deb-src http://deb.debian.org/debian/ bookworm-updates main non-free non-free-firmware

****************************************************



apt-cache policy | sed -n 's/.o=\([^,]\+\)./\1/p' | uniq
****************************************************

$ apt-cache policy | sed -n 's/.o=\([^,]\+\)./\1/p' | uniq
code stable
Tailscale
proton-gitlab
debian squeeze
Debian
microsoft-debian-bookworm-prod bookworm
Google LLC
Brave Software
Debian Backports
Debian
****************************************************




apt-cache policy mariadb-server
****************************************************

$ apt-cache policy mariadb-server
mariadb-server:
Installed: (none)
Candidate: 1:10.11.6-0+deb12u1
Version table:
1:10.11.6-0+deb12u1 500
500 https://ftp.debian.org/debian bookworm/main amd64 Packages
500 http://deb.debian.org/debian bookworm/main amd64 Packages
500 http://mirrors.hostiserver.com/debian bookworm/main amd64 Packages
500 http://debian-archive.trafficmanager.net/debian bookworm/main amd64 Packages
500 https://mirrors.accretive-networks.net/debian bookworm/main amd64 Packages
500 http://mirror.keystealth.org/debian bookworm/main amd64 Packages
****************************************************


I am researching the commands you provided - but, I have to admit to not knowing much about the second command ("apt-cache policy | sed -n 's/.o=\([^,]\+\)./\1/p' | uniq"). I have tried checking out these sites for more information (1. https://linux.die.net/man/1/sed, and 2. https://explainshell.com), but I didn't get very far in understanding what was being sought after. From what I understand, you ran the apt-cache policy through the Streaming Text Editor (this is where my understanding breaks down with the arguments [???] provided) - which are then filtered through for uniq entries - do I have that correct?

Also, what were those arguments for exactly?
 
Last edited:
You have issues with repositories, see section "Don't make a FrankenDebian" on the link below:

To fix your problem you need to get rid of repo that offers debian squeeze packages and also other 4 repos that are reported by apt-cache policy
What's likely happening is that you're downloading the package not from debian but from incompatible repo.

If you absolutely must use other repositories then pin specific packages that you need and ignore the rest so that debian repo is favored, see link below for more info:

Your sources.list is also not OK, it should look like this:
Bash:
deb https://deb.debian.org/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://deb.debian.org/debian/ bookworm main non-free non-free-firmware contrib

deb https://security.debian.org/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src https://security.debian.org/debian-security bookworm-security main non-free non-free-firmware contrib

deb https://deb.debian.org/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://deb.debian.org/debian/ bookworm-updates main non-free non-free-firmware contrib

deb https://deb.debian.org/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://deb.debian.org/debian/ bookworm-backports main non-free non-free-firmware contrib

This is all fixable what is not fixable is that your system is dirty, there is no way to revert to stable.
 
I am reading the AptConfiguration documentation that you provided. Sorry for needing to have this broken down further - but I need clarification on some of the things you mentioned, as I am still learning:


1.
**************************************************
"To fix your problem you need to get rid of repo that offers debian squeeze packages and also other 4 repos that are reported by apt-cache policy"
**************************************************

I am trying to search for the specific repo which offers the Debian squeeze packages - the gameplan is to use the list that you provided to cross-reference to narrow them down. The best thing that I can think of are the mirrors that appear.

Regarding the latter four repos (the bold listings seen below) are those the ones that you mention?
****************************************************
$ apt-cache policy mariadb-server
mariadb-server:
Installed: (none)
Candidate: 1:10.11.6-0+deb12u1
Version table:
1:10.11.6-0+deb12u1 500
500 https://ftp.debian.org/debian bookworm/main amd64 Packages
500 http://deb.debian.org/debian bookworm/main amd64 Packages
500 http://mirrors.hostiserver.com/debian bookworm/main amd64 Packages
500 http://debian-archive.trafficmanager.net/debian bookworm/main amd64 Packages
500 https://mirrors.accretive-networks.net/debian bookworm/main amd64 Packages
500 http://mirror.keystealth.org/debian bookworm/main amd64 Packages
****************************************************



2.
****************************************************
"This is all fixable what is not fixable is that your system is dirty, there is no way to revert to stable."
****************************************************

I am confused here: what do you mean by "dirty?" Am I correct in saying that according to what you're saying, the only way to "revert to stable" is to reinstall the OS?

3. Regarding the second apt-cache command that you recommended: I have to admit to not knowing much about the second command ("apt-cache policy | sed -n 's/.o=\([^,]\+\)./\1/p' | uniq"). I have tried checking out these sites for more information (1. https://linux.die.net/man/1/sed, and 2. https://explainshell.com), but I didn't get very far in understanding what was being sought after. From what I understand, you ran the apt-cache policy through the Streaming Text Editor (this is where my understanding breaks down with the arguments [???] provided) - which are then filtered through for uniq entries - do I have that correct? And, if I do have it correct, what does that command do exactly?
 
I am trying to search for the specific repo which offers the Debian squeeze packages - the gameplan is to use the list that you provided to cross-reference to narrow them down. The best thing that I can think of are the mirrors that appear.
None of the 3 commands will tell you which one is it, those commands are useful to identify repositories that are used, the apt-cache policy command lists all currently used repos.

These additional repos are configured in /etc/apt/sources.list.d directory.

In your terminal run:
ls /etc/apt/sources.list.d

And it will list files for all custom repositories that you configured so far.

Here is an example of a file:

Code:
Types: deb
URIs: https://dl.winehq.org/wine-builds/debian
Suites: bookworm
Components: main
Architectures: amd64 i386
Signed-By: /etc/apt/keyrings/winehq-archive.key

In this example the repository URI is https://dl.winehq.org/wine-builds/debian which is what get's reported by apt-cache policy command.
In this file under Suites it's stated that bookworm directory is used which is fine, however if you find squeeze mentioned or anything else it's not OK and the file should be removed followed by running sudo apt update

File might be in different format but your job is to find which one mentions squeeze because mixing squeeze with debian 12 can't bring anything good.

Regarding the latter four repos (the bold listings seen below) are those the ones that you mention?
Yes, all of those 4 are potential trouble makers because priority for all of them is 500 which prevents the package to be downloaded from debian stable, in fact there are special rules that apply on which repo is used when priority is same.
But you have no control of these rules other than lowering priorities and pinning specific packages.
None of those 4 are taking package from squeeze but you should get rid of squeeze anyway.
The other 2 are official debian repos and you want to keep only those to be able to install the mariadb-server
Or alternatively keep them but configure pinning so that only packages you need are downloaded from those links.

I am confused here: what do you mean by "dirty?" Am I correct in saying that according to what you're saying, the only way to "revert to stable" is to reinstall the OS?
It depends on how long you're using those repositories and how are they used? see /etc/apt/preferences.d and /etc/apt/sources.list.d

If you're using them for longer time and if a bunch of incompatible software was downloaded so far from them then it may be very difficult to remove those packages because how do you know which ones were downloaded? you likely don't...
Even if you succeed in removing all of them there is no guarantee that some of them didn't modify some files on system.
That's why system is dirty, because something went wrong and it's very difficult to restore order with 100% certainty.

You can fix the problem with repositories and install mariadb-server but to restore the system you'll need additional work.
Here is a command that will help you identify which packages were downloaded by each repository listed:

aptitude search '?narrow(?installed,?origin(ORIGIN))'
In the above command replace ORIGIN with a link that is reported by apt-cache policy | sed ..., you have multiple links that are not official repos so you should run it for each link to identify all packages.
Next step requires to purge (permanently remove) those packages but this might break other packages if other packages depend on them.
But even if you do this system is still dirty because no guarantee that nothing that is left wasn't modified, especially if you also installed software outside apt

Regarding the second apt-cache command that you recommended: I have to admit to not knowing much about the second command ("apt-cache policy | sed -n 's/.o=\([^,]\+\)./\1/p' | uniq")
the apt-cache policy <package_name> will list current apt repository setup for that package, that is which one will be used to download it, output of the command is piped to sed which filters out only repository links and throws away the rest.
 
Last edited:
Apologies on the late response, as I have been researching in order to fully understand your response; as I don't wish to waste anyone's time, I will follow up, once I fully grasp it.
 
Feel free to ask anything you want, btw. I have only now figured another problem in out your output in your post #6

Output is:
$ apt-cache policy mariadb-server
mariadb-server:
Installed: (none)
Candidate: 1:10.11.6-0+deb12u1
Version table:
1:10.11.6-0+deb12u1 500
500 https://ftp.debian.org/debian bookworm/main amd64 Packages
500 http://deb.debian.org/debian bookworm/main amd64 Packages
500 http://mirrors.hostiserver.com/debian bookworm/main amd64 Packages
500 http://debian-archive.trafficmanager.net/debian bookworm/main amd64 Packages
500 https://mirrors.accretive-networks.net/debian bookworm/main amd64 Packages
500 http://mirror.keystealth.org/debian bookworm/main amd64 Packages

Problem here is not only 4 repos marked in bold but also other 2 debian repos are both pointing to "main"
You only need 1 of these 2 to install packages because both offer exactly the same packages.
 
Okay, I'm confused about the repositories.

1.
a. What do the highlighted parts below signify? I ask, because Bookworm is the release name - but I don't believe the other items are "releases," per se (namely: "bookworm-security," "bookworm-updates," "bookworm-backports,") - so, what are they?

************************************************************************************
deb https://deb.debian.org/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://deb.debian.org/debian/ bookworm main non-free non-free-firmware contrib

deb https://security.debian.org/debian-security bookworm-security main non-free non-free-firmware contrib
deb-src https://security.debian.org/debian-security bookworm-security main non-free non-free-firmware contrib

deb https://deb.debian.org/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://deb.debian.org/debian/ bookworm-updates main non-free non-free-firmware contrib

deb https://deb.debian.org/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://deb.debian.org/debian/ bookworm-backports main non-free non-free-firmware contrib


b.
"Problem here is not only 4 repos marked in bold but also other 2 debian repos are both pointing to "main"
You only need 1 of these 2 to install packages because both offer exactly the same packages."


If I am understanding you correctly (in that "main non-free non-free-firmware contrib" are packages) - wouldn't the fact that they are repeatedly mentioned in your repository example also cause some type of overlapping conflict?
************************************************************************************

2. Regarding "sed -n 's/.o=\([^,]\+\)./\1/p' ": what does the highlit text mean? I gather from the man page that the "-n" means to suppress certain items - but the text afterwards doesn't make sense.
 

Members online


Top