kubectl 报错 _get_comp_words_by_ref: command not found

guxiaobai / 2023-08-10 / 原文

问题:

  kubectl 使用 tab 补齐命令时,补出来个这玩意 _get_comp_words_by_ref: command not found 。

 

解决办法

1、安装 bash-completion

apt install bash-completion -y

  centos 服务器用 yum install bash-completion -y

 

2、执行bash_completion

source /usr/share/bash-completion/bash_completion

 

3、重新加载kubectl completion

source <(kubectl completion bash)

 

问题解决了。

 

 

 

 

参考:https://blog.csdn.net/qq_29974229/article/details/102890267