Bug#1126304: apt upgrade and 'Failed to take /etc/passwd lock: Invalid argument'
Jeffrey Walton
noloader at gmail.com
Fri Jan 23 23:17:01 GMT 2026
Package: systemd
Version: 257.9-1~deb13u1
Tags: trixie
I'm working with Debian 13 (Trixie) on a Windows machine. Debian was
installed via Windows Subsystem for Linux (WSL). When I run `apt-get
upgrade` I receive the error shown below.
The machine uses WSL v1. I cannot convert to WSL v2 due to company
policy. WSL v2 is considered too risky due to lack of security
controls for some operations.
There's a good Q&A on Super User about the problem:
<https://superuser.com/q/1803992>. One person identified the problem:
<https://superuser.com/a/1805742>. Another person's answer seems very
relevant: <https://superuser.com/a/1912487>. In the answer, the
poster says:
The simplest fix is to just disable error-checking on calls to
systemd-sysusers so it doesn't prevent the post-install scripts from
completing. This can be done with the following command...
Debian should consider ignoring failures in calls
`fcntl(F_OFD_SETLKW)`. Or, go back to the old `fcntl(F_SETLKW)`.
Or another workaround?
----------
$ sudo apt-get upgrade
...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Setting up systemd (257.9-1~deb13u1) ...
Failed to take /etc/passwd lock: Invalid argument
dpkg: error processing package systemd (--configure):
installed systemd package post-installation script subprocess
returned error exit status 1
dpkg: dependency problems prevent configuration of systemd-sysv:
systemd-sysv depends on systemd (= 257.9-1~deb13u1); however:
Package systemd is not configured yet.
systemd-sysv depends on systemd; however:
Package systemd is not configured yet.
dpkg: error processing package systemd-sysv (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
systemd
systemd-sysv
More information about the Pkg-systemd-maintainers
mailing list