为什么“sudo apt update”的输出中会出现带有“cnf Metadata”的行?

DK *_*ose 15 updates apt

库本图 19.10

我不能说这是什么时候开始的,但是输出sudo apt updatec-n-f Metadata.

...                                                       
Hit:11 http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu eoan InRelease                                                  
Get:12 http://security.ubuntu.com/ubuntu eoan-security/main amd64 c-n-f Metadata [232 B]               
Get:13 http://security.ubuntu.com/ubuntu eoan-security/universe amd64 Packages [2,404 B]
Get:14 http://security.ubuntu.com/ubuntu eoan-security/universe amd64 c-n-f Metadata [288 B]
Fetched 445 kB in 2s (195 kB/s)                         
Reading package lists... Done
...
Run Code Online (Sandbox Code Playgroud)

我发现 请将 cnf 支持添加到 debmirror指示cnf扩展为“未找到命令”,但在阅读后我在理解它在sudo apt update. 它的目的是什么?

小智 2

Ubuntu (21.04) 软件包command-not-found包含/etc/apt/apt.conf.d/50command-not-found使apt(8)在更新时检查c-n-f Metadata存储库中的条目。

如果安装了这个,bash(1)zsh(1) shell 将生成一条建议以及缺少命令的错误消息,例如:

user@ubuntu:~$ rogue
Command 'rogue' not found, but can be installed with:
sudo apt install bsdgames-nonfree
user@ubuntu:~$ 
Run Code Online (Sandbox Code Playgroud)

Ubuntu 的bash(1)全局配置文件/etc/bash.bashrc检查command-not-found并加载它的处理程序例程(如果存在)。

下载的命令存储在(如kulfy/var/lib/apt/lists/*_cnf_Commands提到的)中 ,聚合数据存储在 SQLite/json 中。
/var/lib/command-not-found/