HEX
Server: Apache
System: Linux server3230.server-vps.com 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: lzgqnjwu (1002)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //lib/update-notifier/package-system-locked
#!/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