APT Linux User invalid password settings

I tried installing the package “default-mysql-server” via apt. Like this sudo apt install default-mysql-server.

While the install was running i got this error:

Preparing to unpack .../mariadb-server_1%3a10.11.11-0+deb12u1_arm64.deb ...
dpkg: error processing archive /var/cache/apt/archives/mariadb-server_1%3a10.11.11-0+deb12u1_arm64.deb (--unpack):
 new mariadb-server package pre-installation script subprocess returned error exit status 1
Selecting previously unselected package default-mysql-server.
Preparing to unpack .../default-mysql-server_1.1.0_all.deb ...
Unpacking default-mysql-server (1.1.0) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mariadb-server_1%3a10.11.11-0+deb12u1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

For me this error said nothing that would help me, so i tried to finde some solutions online and came across, that maybe the created mysql user password had an error, so i checked it:

sudo chage -l mysql
Last password change                    : May 12, 2025
Password expires                    : never
Password inactive                   : never
Account expires                     : never
Minimum number of days between password change      : -1
Maximum number of days between password change      : -1
Number of days of warning before password expires   : -1

I could not find any documentation what -1 represents, but for me it looks off, i now that most of the time its 0 99999 7.

Im running Debian 12 Version: 6.1.0-34-arm64. On older machines i did not get this error, but now i got three machines with the same version, having the same problem.

I checked also my root and sudo user but they looked fine like always no -1 or something else, so my guess is that something is off with apt but not sure.

I also tried to install it as the root user without sudo but still got the same error. Also i rebooted and reinstalled debian on that system, but nothing seems to effect this. If someone knows this issued and can help, that would be awesome.

If more informations are need feel free to ask, i really would like to now whats the matter with this.

1 Like

The error message you’re encountering during the installation of the default-mysql-server package on Debian 12 indicates an issue with the MariaDB pre-installation script. This is a known problem, often related to AppArmor restrictions or incomplete package configurations.

Here are some steps you can take to resolve the issue:

1. Reconfigure the Package Database

Sometimes, the package database may become corrupted. Reconfiguring it can resolve such issues:

sudo dpkg --configure -a

2. Fix Broken Dependencies

Attempt to fix any broken dependencies that might be causing the installation to fail:

sudo apt install -f

3. Purge and Reinstall MariaDB

If the above steps don’t work, you might need to remove and then reinstall the MariaDB packages:

sudo apt-get remove --purge mariadb-server mariadb-client
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mariadb-server mariadb-client

4. Check AppArmor Status

AppArmor can sometimes interfere with MariaDB’s installation. To check if AppArmor is active:

sudo systemctl status apparmor

If it’s active, you might consider disabling it temporarily to see if it resolves the issue:

sudo systemctl stop apparmor
sudo systemctl disable apparmor

After testing, you can re-enable AppArmor:

sudo systemctl enable apparmor
sudo systemctl start apparmor

5. Examine the Pre-Installation Script

To gain more insight into the error, examine the pre-installation script for the MariaDB package:

sudo nano /var/lib/dpkg/info/mariadb-server.preinst

Look for any lines that might be causing the script to fail. Adding set -x at the beginning of the script can enable debugging output, which might help identify the problem.

After making any changes, reconfigure the package:

sudo dpkg --configure -a

6. Check for Disk Space Issues

Ensure that your system has sufficient disk space, as a lack of space can cause installation failures:

df -h

If your root partition is full, consider freeing up space or expanding the partition.

7. Review System Logs

Check system logs for any related errors that might provide more context:

journalctl -xe

Look for entries related to mariadb or dpkg to identify any underlying issues.

By following these steps, you should be able to identify and resolve the issue preventing the installation of the default-mysql-server package on your Debian 12 system.