You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WSL中Bash输入不存在命令时不显示包建议的问题求助

WSL中Bash输入不存在命令时不显示包建议的问题求助

最近我发现WSL里的Bash控制台突然不显示命令对应的包建议了,挺奇怪的。因为我平时常用ZSH,在Oh My ZSH里装了command-not-found插件后,这个功能是正常工作的,我的.zshrc里的插件配置是这样的:

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting command-not-found)

后来我试着给Bash装了command-not-found包,用的命令是:

sudo apt install command-not-found

但装完之后还是没效果,现在输入不存在的命令比如sido,只会显示:

$ sido
bash: sido: command not found

而我期望的结果应该是这样的:

$ sido
No command 'sido' found, did you mean:
 Command 'sudo' from package 'sudo' (main)
 Command 'sudo' from package 'sudo-ldap' (universe)

我找了好半天都没找到解决办法,有没有大佬能帮忙看看怎么处理这个问题呀?

备注:内容来源于stack exchange,提问作者Benevos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 11:24:35