HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux 194-195-117-163.ip.linodeusercontent.com 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64
User: www-data (33)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //usr/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