I could successfully verify this SRU inside a Focal LXD container for command-not-found 20.04.4:
root@f:~# dpkg -l | grep command-not-found
ii command-not-found 20.04.4 all Suggest installation of packages in interactive bash sessions
ii python3-commandnotfound 20.04.4 all Python 3 bindings for command-not-found.
root@f:~# apt update
...
root@f:~# cp /var/lib/command-not-found/commands.db /var/lib/command-not-found/commands.db.tmp
root@f:~# ll /var/lib/command-not-found/
total 6064
drwxr-xr-x 2 root root 4096 Aug 27 07:11 ./
drwxr-xr-x 24 root root 4096 Aug 27 07:08 ../
-rw-r--r-- 1 root root 3096576 Aug 27 07:11 commands.db
-rw-r--r-- 1 root root 3634 Aug 27 07:11 commands.db.metadata
-rw-r--r-- 1 root root 3096576 Aug 27 07:11 commands.db.tmp
root@f:~# sqlite3 /var/lib/command-not-found/commands.db.tmp
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> PRAGMA locking_mode = EXCLUSIVE;
exclusive
sqlite> BEGIN EXCLUSIVE;
sqlite>
root@f:~# rm /var/lib/command-not-found/commands.db.metadata
root@f:~# /usr/lib/cnf-update-db --verbose
WARNING:root:/var/lib/command-not-found/commands.db.tmp is locked by another process. Ignoring.
root@f:~# echo $?
0
After the database is unlocked, the application runs as expected:
root@f:~# /usr/lib/cnf-update-db --verbose
INFO:root:processed 14855 packages in 1.45s
Hello Lukasz,
I could successfully verify this SRU inside a Focal LXD container for command-not-found 20.04.4: commandnotfound 20.04.4 all Python 3 bindings for command-not-found.
root@f:~# dpkg -l | grep command-not-found
ii command-not-found 20.04.4 all Suggest installation of packages in interactive bash sessions
ii python3-
root@f:~# apt update command- not-found/ commands. db /var/lib/ command- not-found/ commands. db.tmp command- not-found/ db.metadata command- not-found/ commands. db.tmp
...
root@f:~# cp /var/lib/
root@f:~# ll /var/lib/
total 6064
drwxr-xr-x 2 root root 4096 Aug 27 07:11 ./
drwxr-xr-x 24 root root 4096 Aug 27 07:08 ../
-rw-r--r-- 1 root root 3096576 Aug 27 07:11 commands.db
-rw-r--r-- 1 root root 3634 Aug 27 07:11 commands.
-rw-r--r-- 1 root root 3096576 Aug 27 07:11 commands.db.tmp
root@f:~# sqlite3 /var/lib/
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> PRAGMA locking_mode = EXCLUSIVE;
exclusive
sqlite> BEGIN EXCLUSIVE;
sqlite>
root@f:~# rm /var/lib/ command- not-found/ commands. db.metadata cnf-update- db --verbose root:/var/ lib/command- not-found/ commands. db.tmp is locked by another process. Ignoring.
root@f:~# /usr/lib/
WARNING:
root@f:~# echo $?
0
After the database is unlocked, the application runs as expected: cnf-update- db --verbose
root@f:~# /usr/lib/
INFO:root:processed 14855 packages in 1.45s