![如何使用 command-not-found 要求安装软件包而不是建议安装它](https://linux22.com/image/230599/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20command-not-found%20%E8%A6%81%E6%B1%82%E5%AE%89%E8%A3%85%E8%BD%AF%E4%BB%B6%E5%8C%85%E8%80%8C%E4%B8%8D%E6%98%AF%E5%BB%BA%E8%AE%AE%E5%AE%89%E8%A3%85%E5%AE%83.png)
command-not-found
当在 Kali Linux 中找不到该命令时会问这样的问题:
Command 'co' not found, but can be installed with:
sudo apt install rcs
Do you want to install it? (N/y)
然而,在 Debian 中,它只建议使用以下命令安装软件包
Command 'co' not found, but can be installed with:
sudo apt install rcs
如何让 Debian 要求安装软件包command-not-found
?
答案1
添加COMMAND_NOT_FOUND_INSTALL_PROMPT=1
到/etc/environment
并重新启动reboot
。这将提示安装该命令的软件包。它适用于所有支持command-not-found
.