Script started on 2022-02-02 17:35:20+00:00 [TERM="xterm-256color" TTY="/dev/pts/1" COLUMNS="185" LINES="73"] ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# dpkg -l | grep command-not-found ii command-not-found 20.04.5 all Suggest installation of packages in interactive bash sessions ii python3-commandnotfound 20.04.5 all Python 3 bindings for command-not-found. ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# ls -lah /var/lib/command-not-found/ total 3.2M drwxr-xr-x 1 root root 62 Feb 2 17:35 . drwxr-xr-x 1 root root 596 Jan 28 19:36 .. -rw-r--r-- 1 root root 3.2M Feb 2 17:35 commands.db -rw-r--r-- 1 root root 3.2K Feb 2 17:35 commands.db.metadata ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Test that cnf is working as unprivileged user ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# su - ubuntu ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ lck Command 'lck' not found, did you mean: command 'ack' from deb ack (3.3.1-1) command 'ick' from deb intercal (30:0.30-3) command 'lcp' from deb lsh-client (2.1-12build3) command 'lc' from deb mono-devel (6.8.0.105+dfsg-2) command 'lcf' from deb ucf (3.0038+nmu1) command 'ck' from deb python3-ck (1.9.4-1.1) Try: apt install ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ ack Command 'ack' not found, but can be installed with: apt install ack Please ask your administrator. ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ exit logout ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Begin reproducer ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Confirm UMASK ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# grep "^UMASK" /etc/login.defs UMASK 022 ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Set /etc/login.defs to umask 027 ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# sed -i -e 's/^UMASK\t\t022/UMASK\t\t027/' /etc/login.defs ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Confirm ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# grep "^UMASK" /etc/login.defs UMASK 027 ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Log out and back in ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# exit exit Script done on 2022-02-02 17:36:03+00:00 [COMMAND_EXIT_CODE="0"] Script started on 2022-02-02 17:36:47+00:00 [TERM="xterm-256color" TTY="/dev/pts/1" COLUMNS="185" LINES="73"] ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Force rebuild of DB ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# rm -rf /var/lib/command-not-found/* ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# apt update  0% [Working] Hit:1 http://archive.canonical.com/ubuntu focal InRelease Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease  0% [Waiting for headers] Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease  0% [Working] 0% [Waiting for headers] 0% [Waiting for headers] Hit:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease  0% [Waiting for headers] 0% [Waiting for headers] Hit:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease  0% [Working] 0% [Working] 20% [Working] Reading package lists... 0% Reading package lists... 0% Reading package lists... 0% Reading package lists... 4% Reading package lists... 4% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 42% Reading package lists... 42% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 68% Reading package lists... 68% Reading package lists... 72% Reading package lists... 72% Reading package lists... 76% Reading package lists... 76% Reading package lists... 77% Reading package lists... 77% Reading package lists... 81% Reading package lists... 81% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 87% Reading package lists... 87% Reading package lists... 90% Reading package lists... 90% Reading package lists... 90% Reading package lists... 94% Reading package lists... 94% Reading package lists... 95% Reading package lists... 95% Reading package lists... 98% Reading package lists... 98% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... Done Building dependency tree... 0% Building dependency tree... 0% Building dependency tree... 0% Building dependency tree... 50% Building dependency tree... 50% Building dependency tree Reading state information... 0% Reading state information... 0% Reading state information... Done All packages are up to date. ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# ls -lah /var/lib/command-not-found/ total 3.2M drwxr-xr-x 1 root root 62 Feb 2 17:37 . drwxr-xr-x 1 root root 596 Jan 28 19:36 .. -rw-r----- 1 root root 3.2M Feb 2 17:37 commands.db -rw-r----- 1 root root 3.2K Feb 2 17:37 commands.db.metadata ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Verify failure ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# su - ubuntu ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ lck Sorry, command-not-found has crashed! Please file a bug report at: https://bugs.launchpad.net/command-not-found/+filebug Please include the following information with the report: command-not-found version: 0.3 Python version: 3.8.10 final 0 Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal Exception information: unable to open database file Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 23, in crash_guard callback() File "/usr/lib/command-not-found", line 90, in main cnf = CommandNotFound.CommandNotFound(options.data_dir) File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 79, in __init__ self.db = SqliteDatabase(dbpath) File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 12, in __init__ self.con = sqlite3.connect(filename) sqlite3.OperationalError: unable to open database file ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ ack Sorry, command-not-found has crashed! Please file a bug report at: https://bugs.launchpad.net/command-not-found/+filebug Please include the following information with the report: command-not-found version: 0.3 Python version: 3.8.10 final 0 Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal Exception information: unable to open database file Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 23, in crash_guard callback() File "/usr/lib/command-not-found", line 90, in main cnf = CommandNotFound.CommandNotFound(options.data_dir) File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 79, in __init__ self.db = SqliteDatabase(dbpath) File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 12, in __init__ self.con = sqlite3.connect(filename) sqlite3.OperationalError: unable to open database file ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ exit logout ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Update to proposed package ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# add-apt-repository -y ppa:krenshaw/lp1953610 0% [Working] Hit:1 http://archive.canonical.com/ubuntu focal InRelease 0% [Waiting for headers] [Waiting for headers] [Waiting for headers] Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease 0% [Waiting for headers] [Waiting for headers] 0% [Waiting for headers] [Waiting for headers] Get:3 http://ppa.launchpad.net/krenshaw/lp1953610/ubuntu focal InRelease [18.1 kB] 0% [Waiting for headers] [3 InRelease 13.0 kB/18.1 kB 72%] 0% [Waiting for headers] Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease 0% [Working] 0% [Waiting for headers] Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease 0% [Working] 0% [Waiting for headers] Get:6 http://ppa.launchpad.net/krenshaw/lp1953610/ubuntu focal/main amd64 Packages [752 B] 0% [Waiting for headers] [6 Packages 0 B/752 B 0%] 0% [Waiting for headers] 0% [6 Packages store 0 B] [Waiting for headers] [Waiting for headers] 0% [Waiting for headers] [Waiting for headers] Get:7 http://ppa.launchpad.net/krenshaw/lp1953610/ubuntu focal/main Translation-en [372 B] 0% [Waiting for headers] [7 Translation-en 0 B/372 B 0%] 0% [Waiting for headers] 0% [7 Translation-en store 0 B] [Waiting for headers] 0% [Waiting for headers] 0% [Waiting for headers] Hit:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease 0% [Working] 0% [Working] 100% [Working] Fetched 19.2 kB in 1s (21.4 kB/s) Reading package lists... 0% Reading package lists... 0% Reading package lists... 0% Reading package lists... 4% Reading package lists... 4% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 42% Reading package lists... 42% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 68% Reading package lists... 68% Reading package lists... 72% Reading package lists... 72% Reading package lists... 76% Reading package lists... 76% Reading package lists... 77% Reading package lists... 77% Reading package lists... 81% Reading package lists... 81% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 87% Reading package lists... 87% Reading package lists... 90% Reading package lists... 90% Reading package lists... 91% Reading package lists... 94% Reading package lists... 94% Reading package lists... 95% Reading package lists... 95% Reading package lists... 98% Reading package lists... 98% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... Done ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# apt update  0% [Working] Hit:1 http://ppa.launchpad.net/krenshaw/lp1953610/ubuntu focal InRelease  0% [Waiting for headers] [Waiting for headers] [Waiting for headers] Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease Hit:5 http://archive.canonical.com/ubuntu focal InRelease Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease  0% [Working] 0% [Working] 0% [Working] 0% [Working] 0% [Working] 0% [Working] 20% [Working] Reading package lists... 0% Reading package lists... 0% Reading package lists... 0% Reading package lists... 4% Reading package lists... 4% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 42% Reading package lists... 42% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 68% Reading package lists... 68% Reading package lists... 72% Reading package lists... 72% Reading package lists... 76% Reading package lists... 76% Reading package lists... 77% Reading package lists... 77% Reading package lists... 81% Reading package lists... 81% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 87% Reading package lists... 87% Reading package lists... 90% Reading package lists... 90% Reading package lists... 91% Reading package lists... 94% Reading package lists... 94% Reading package lists... 95% Reading package lists... 95% Reading package lists... 98% Reading package lists... 98% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... Done Building dependency tree... 0% Building dependency tree... 0% Building dependency tree... 0% Building dependency tree... 50% Building dependency tree... 50% Building dependency tree Reading state information... 0% Reading state information... 0% Reading state information... Done 2 packages can be upgraded. Run 'apt list --upgradable' to see them. ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# apt -y upgrade Reading package lists... 0% Reading package lists... 100% Reading package lists... Done Building dependency tree... 0% Building dependency tree... 0% Building dependency tree... 50% Building dependency tree... 50% Building dependency tree Reading state information... 0% Reading state information... 0% Reading state information... Done Calculating upgrade... 0% Calculating upgrade... 10% Calculating upgrade... Done The following package was automatically installed and is no longer required: libfreetype6 Use 'apt autoremove' to remove it. The following packages will be upgraded: command-not-found python3-commandnotfound 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 33.7 kB of archives. After this operation, 0 B of additional disk space will be used.  0% [Working] Get:1 http://ppa.launchpad.net/krenshaw/lp1953610/ubuntu focal/main amd64 command-not-found all 20.04.5ubuntu2 [14.8 kB]  31% [1 command-not-found 13.0 kB/14.8 kB 88%] 45% [Working] Get:2 http://ppa.launchpad.net/krenshaw/lp1953610/ubuntu focal/main amd64 python3-commandnotfound all 20.04.5ubuntu2 [18.8 kB]  45% [2 python3-commandnotfound 0 B/18.8 kB 0%] 100% [Working] Fetched 33.7 kB in 0s (717 kB/s) 78(Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 44293 files and directories currently installed.) Preparing to unpack .../command-not-found_20.04.5ubuntu2_all.deb ... 7Progress: [ 0%] [...................................................................................................................................................................] 87Progress: [ 11%] [##################.................................................................................................................................................] 8Unpacking command-not-found (20.04.5ubuntu2) over (20.04.5) ... 7Progress: [ 22%] [####################################...............................................................................................................................] 8Preparing to unpack .../python3-commandnotfound_20.04.5ubuntu2_all.deb ... 7Progress: [ 33%] [######################################################.............................................................................................................] 8Unpacking python3-commandnotfound (20.04.5ubuntu2) over (20.04.5) ... 7Progress: [ 44%] [########################################################################...........................................................................................] 8Setting up python3-commandnotfound (20.04.5ubuntu2) ... 7Progress: [ 56%] [##########################################################################################.........................................................................] 87Progress: [ 67%] [############################################################################################################.......................................................] 8Setting up command-not-found (20.04.5ubuntu2) ... 7Progress: [ 78%] [##############################################################################################################################.....................................] 87Progress: [ 89%] [################################################################################################################################################...................] 8 78]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Rebuild cnf db again ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# rm -rf /var/lib/command-not-found/* ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# apt update  0% [Working] Hit:1 http://ppa.launchpad.net/krenshaw/lp1953610/ubuntu focal InRelease  0% [Waiting for headers] [Waiting for headers] [Waiting for headers] Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease Hit:5 http://archive.canonical.com/ubuntu focal InRelease Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease  0% [Working] 0% [Working] 0% [Working] 0% [Working] 0% [Working] 0% [Working] 20% [Working] Reading package lists... 0% Reading package lists... 0% Reading package lists... 0% Reading package lists... 4% Reading package lists... 4% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 6% Reading package lists... 42% Reading package lists... 42% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 62% Reading package lists... 68% Reading package lists... 68% Reading package lists... 72% Reading package lists... 72% Reading package lists... 76% Reading package lists... 76% Reading package lists... 77% Reading package lists... 77% Reading package lists... 81% Reading package lists... 81% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 82% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 83% Reading package lists... 87% Reading package lists... 87% Reading package lists... 89% Reading package lists... 90% Reading package lists... 90% Reading package lists... 94% Reading package lists... 94% Reading package lists... 95% Reading package lists... 95% Reading package lists... 98% Reading package lists... 98% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... 99% Reading package lists... Done Building dependency tree... 0% Building dependency tree... 0% Building dependency tree... 0% Building dependency tree... 50% Building dependency tree... 50% Building dependency tree Reading state information... 0% Reading state information... 0% Reading state information... Done All packages are up to date. ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# ls -lah /var/lib/command-not-found/ total 3.2M drwxr-xr-x 1 root root 62 Feb 2 17:37 . drwxr-xr-x 1 root root 596 Jan 28 19:36 .. -rw-r--r-- 1 root root 3.2M Feb 2 17:37 commands.db -rw-r--r-- 1 root root 3.2K Feb 2 17:37 commands.db.metadata ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# # Verify successful cnf with more restrictive umask ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# su - ubuntu ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ lck Command 'lck' not found, did you mean: command 'lcp' from deb lsh-client (2.1-12build3) command 'ack' from deb ack (3.3.1-1) command 'lc' from deb mono-devel (6.8.0.105+dfsg-2) command 'lcf' from deb ucf (3.0038+nmu1) command 'ck' from deb python3-ck (1.9.4-1.1) command 'ick' from deb intercal (30:0.30-3) Try: apt install ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ ack Command 'ack' not found, but can be installed with: apt install ack Please ask your administrator. ]0;ubuntu@lp1953610-focal: ~ubuntu@lp1953610-focal:~$ exit logout ]0;root@lp1953610-focal: ~root@lp1953610-focal:~# exit exit Script done on 2022-02-02 17:38:04+00:00 [COMMAND_EXIT_CODE="127"]