Package: command-not-found
Version: 18.04.5-1
Severity: grave
Justification: renders package unusable

Dear Maintainer,

Trying to execute any command that is not found (e.g. entering aaaa at the 
command line) gives the following output:

-----------------------------------

Could not find the database of available applications, run
update-command-not-found as root to fix this
Sorry, command-not-found has crashed! Please file a bug report at:
http://www.debian.org/Bugs/Reporting
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.7.3 final 0
Distributor ID: PureOS
Description:    PureOS
Release:        8
Codename:       green
Exception information:

local variable 'cnf' referenced before assignment
Traceback (most recent call last):
  File "/usr/share/command-not-found/CommandNotFound/util.py", line 23,
in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 93, in main
    if not cnf.advise(args[0], options.ignore_installed) and not
options.no_failure_msg:
UnboundLocalError: local variable 'cnf' referenced before assignment

------------------------------------

The first line of the output suggests to run update-command-not-found as root 
but doing that does not help.
Doing "sudo update-command-not-found" gives no output at all, no error message, 
seemingly it worked OK but the next time command-not-found is run the same 
error message comes anyway.
Maybe update-command-not-found does not work properly, or maybe it places the 
database in a different location than where command-not-found looks for the 
database, I don't know.

There also seems to be a problem around line 93 in the 
/usr/lib/command-not-found code where it tries to use the "cnf" variable 
regardless of the success or failure of the assignment a few lines above.
But if I understand correctly that is just a consequence of the problem that 
the database is not found even after running update-command-not-found.

What I expected: I expected it to not crash but instead say something like 
either "command not found" or "the command can be installed using apt install 
x".

-- System Information:
Distributor ID: PureOS
Description:    PureOS
Release:        8
Codename:       green
Architecture: x86_64

Kernel: Linux 4.19.0-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages command-not-found depends on:
ii  apt-file     3.2.2
ii  lsb-release  10.2019031300pureos1
ii  python3      3.7.3-1
ii  python3-apt  1.8.4pureos1

command-not-found recommends no packages.

Versions of packages command-not-found suggests:
pn  snapd  <none>

-- no debconf information

Reply via email to