0

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.

Kusalananda
355k42 gold badges735 silver badges1.1k bronze badges
asked May 14 at 8:27
7
  • 1
    The -1 looks reasonable. There is no password expiration, so it makes sense to have an invalid number of days before enforcing a password change. Commented May 14 at 8:40
  • 1
    The preinst script is failing. Try running it manually with: 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. Commented May 14 at 8:41
  • I tried to run the command, but got this: 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. Commented May 14 at 9:29
  • Whoops. Should be mariadb-server instead of maria-server. It's the package name. Commented May 14 at 9:34
  • 1
    Like @Stewart, I don't think there's anything wrong with the user. What happens when you try to execute DEBIAN_SCRIPT_DEBUG=1 /var/lib/dpkg/info/mariadb-server.preinst install? Commented May 14 at 11:04

1 Answer 1

0

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.

answered May 20 at 8:45
1
  • 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. Commented May 20 at 8:51

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.