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 Answer 1
Solution
I tried creating a new User and got this error:
You are required to change your password immediately (root enforced)
chfn: PAM: Authentication token is no longer valid; new one required
adduser: `/usr/bin/chfn -f new_user' returned error code 1. Exiting.
I immediately checked the root password:
sudo chage -l root
Last password change : password must be changed
Password expires : password must be changed
Password inactive : password must be changed
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
After that i changed the root password sudo passwd root
and everything was fixed.
Hopefully that will help someone who got the same problem.
-
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.2025年05月20日 08:51:43 +00:00Commented May 20 at 8:51
-1
looks reasonable. There is no password expiration, so it makes sense to have an invalid number of days before enforcing a password change.DEBIAN_SCRIPT_DEBUG=1 /var/lib/dpkg/info/maria-server.preinst install
for extra info. My guess is that there is already a db installed, and it's failing to upgrade/migrate that.DEBIAN_SCRIPT_DEBUG=1 /var/lib/dpkg/info/maria-server.preinst install -bash: /var/lib/dpkg/info/maria-server.preinst: No such file or directory
Furthermore i checked on an fresh server if any db was installed, but i found nothing and the apt install failed again with the same output.mariadb-server
instead ofmaria-server
. It's the package name.DEBIAN_SCRIPT_DEBUG=1 /var/lib/dpkg/info/mariadb-server.preinst install
?