/usr/lib/update-notifier/package-system-locked is in update-notifier-common 0.154.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  | #!/bin/sh
# check if package system is locked
# return 0 if unlocked, 2 if locked, 1 on error
set -e
for f in /var/lib/dpkg/lock /var/cache/apt/archives/lock \
    /var/lib/apt/lists/lock /run/unattended-upgrades.lock; do
    [ -e $f ] || continue
    # fuser succeeds if there is at least one user
    if fuser $f; then
        exit 2
    fi
done
exit 0
 |