Debian安装command-not-found

Ubuntu默认装了一个叫command-not-found的包,可以达到这样的效果:

$ virt-what
Command 'virt-what' not found, but can be installed with:
apt install virt-what

实际上,这个包debian就有,只不过默认没装,我们可以手动装下,这个包依赖了apt-file,所以还要把apt-file的数据库update下

$ apt install command-not-found
$ apt-file update
$ update-command-not-found

最后重新进入下终端或者source一下/etc/bash.bashrc即可

此处评论已关闭