On Sat, Apr 03, 2021 at 11:05:32AM +0200, Raphael Hertzog wrote:
> So the latest version doesn't have the same error message (with "cnf"
> variable being unbound) but it still doesn't fail gracefully when
> the database is not available.
>
> Instead of asking to file bug reports, it should tell them to run "apt
> update".

That's what it does since 19.10.0:

 command-not-found (19.10.0) eoan; urgency=medium
  .
     * If the database is absent, do not crash with a backtrace, but
     * tell the
          user to run apt update.

Here's the proof:

jak@jak-t480s:~/Documents$ lxc launch images:debian/sid debian-test -e
Creating debian-test
Starting debian-test
jak@jak-t480s:~/Documents$ lxc exec debian-test bash
root@debian-test:~# apt install command-not-found
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  apt-file ca-certificates distro-info-data iso-codes libapt-pkg-perl 
libexporter-tiny-perl libgdbm-compat4 libgdbm6 liblist-moreutils-perl 
liblist-moreutils-xs-perl libmpdec3 libperl5.32 libpython3-stdlib 
libpython3.9-minimal libpython3.9-stdlib libreadline8
  libregexp-assemble-perl libsqlite3-0 lsb-release media-types openssl perl 
perl-modules-5.32 python-apt-common python3 python3-apt python3-minimal 
python3.9 python3.9-minimal readline-common
Suggested packages:
  snapd isoquery gdbm-l10n sensible-utils perl-doc libterm-readline-gnu-perl | 
libterm-readline-perl-perl make libtap-harness-archive-perl python3-doc 
python3-tk python3-venv python3-apt-dbg python-apt-doc python3.9-venv 
python3.9-doc binutils binfmt-support readline-doc
The following NEW packages will be installed:
  apt-file ca-certificates command-not-found distro-info-data iso-codes 
libapt-pkg-perl libexporter-tiny-perl libgdbm-compat4 libgdbm6 
liblist-moreutils-perl liblist-moreutils-xs-perl libmpdec3 libperl5.32 
libpython3-stdlib libpython3.9-minimal libpython3.9-stdlib libreadline8
  libregexp-assemble-perl libsqlite3-0 lsb-release media-types openssl perl 
perl-modules-5.32 python-apt-common python3 python3-apt python3-minimal 
python3.9 python3.9-minimal readline-common
0 upgraded, 31 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.0 MB of archives.
After this operation, 94.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian sid/main amd64 perl-modules-5.32 all 
5.32.1-3 [2823 kB]
Get:2 http://deb.debian.org/debian sid/main amd64 libgdbm6 amd64 1.19-2 [64.9 
kB]
Get:3 http://deb.debian.org/debian sid/main amd64 libgdbm-compat4 amd64 1.19-2 
[44.7 kB]
Get:4 http://deb.debian.org/debian sid/main amd64 libperl5.32 amd64 5.32.1-3 
[4110 kB]
Get:5 http://deb.debian.org/debian sid/main amd64 perl amd64 5.32.1-3 [293 kB]
Get:6 http://deb.debian.org/debian sid/main amd64 libpython3.9-minimal amd64 
3.9.2-1 [801 kB]
Get:7 http://deb.debian.org/debian sid/main amd64 python3.9-minimal amd64 
3.9.2-1 [1955 kB]
Get:8 http://deb.debian.org/debian sid/main amd64 python3-minimal amd64 3.9.2-3 
[38.2 kB]
Get:9 http://deb.debian.org/debian sid/main amd64 media-types all 4.0.0 [30.3 
kB]
Get:10 http://deb.debian.org/debian sid/main amd64 libmpdec3 amd64 2.5.1-2 
[87.8 kB]
Get:11 http://deb.debian.org/debian sid/main amd64 readline-common all 8.1-1 
[73.7 kB]
Get:12 http://deb.debian.org/debian sid/main amd64 libreadline8 amd64 8.1-1 
[169 kB]
Get:13 http://deb.debian.org/debian sid/main amd64 libsqlite3-0 amd64 3.34.1-3 
[797 kB]
Get:14 http://deb.debian.org/debian sid/main amd64 libpython3.9-stdlib amd64 
3.9.2-1 [1684 kB]
Get:15 http://deb.debian.org/debian sid/main amd64 python3.9 amd64 3.9.2-1 [466 
kB]
Get:16 http://deb.debian.org/debian sid/main amd64 libpython3-stdlib amd64 
3.9.2-3 [21.4 kB]
Get:17 http://deb.debian.org/debian sid/main amd64 python3 amd64 3.9.2-3 [37.9 
kB]
Get:18 http://deb.debian.org/debian sid/main amd64 openssl amd64 1.1.1k-1 [850 
kB]
Get:19 http://deb.debian.org/debian sid/main amd64 ca-certificates all 20210119 
[158 kB]
Get:20 http://deb.debian.org/debian sid/main amd64 libapt-pkg-perl amd64 0.1.40 
[72.2 kB]
Get:21 http://deb.debian.org/debian sid/main amd64 libexporter-tiny-perl all 
1.002002-1 [37.8 kB]
Get:22 http://deb.debian.org/debian sid/main amd64 liblist-moreutils-xs-perl 
amd64 0.430-2 [40.9 kB]
Get:23 http://deb.debian.org/debian sid/main amd64 liblist-moreutils-perl all 
0.430-2 [46.9 kB]
Get:24 http://deb.debian.org/debian sid/main amd64 libregexp-assemble-perl all 
0.36-1.1 [85.5 kB]
Get:25 http://deb.debian.org/debian sid/main amd64 apt-file all 3.2.2 [38.5 kB]
Get:26 http://deb.debian.org/debian sid/main amd64 distro-info-data all 0.46 
[7192 B]
Get:27 http://deb.debian.org/debian sid/main amd64 lsb-release all 11.1.0 [27.9 
kB]
Get:28 http://deb.debian.org/debian sid/main amd64 python-apt-common all 2.1.7 
[96.1 kB]
Get:29 http://deb.debian.org/debian sid/main amd64 python3-apt amd64 2.1.7 [190 
kB]
Get:30 http://deb.debian.org/debian sid/main amd64 command-not-found all 
20.10.1-1 [26.2 kB]
Get:31 http://deb.debian.org/debian sid/main amd64 iso-codes all 4.6.0-1 [2824 
kB]
Fetched 18.0 MB in 1s (28.7 MB/s)
[ ... unpack and install ...]
root@debian-test:~# command-not-found firefox
Could not find command-not-found database. Run 'sudo apt update' to populate it.
firefox: command not found

Logout and back in again:

$ lxc exec debian-test bash
root@debian-test:~# firefox
Could not find command-not-found database. Run 'sudo apt update' to populate it.
firefox: command not found


> This bad behaviour is now generating quite some noise in the
> Debian bug tracker because we have enabled command-not-found in Kali
> and when they get it installed during upgrade (as opposed to during a
> fresh installation), the database is not created during the same apt
> run and they get this error message when they run a missing command:

We only see reports from Kali, I have to assume it's Kali-specific breakage,
and I also do not have the resources to interact with this churn.


--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en

Reply via email to