CentOS 中的 Yum 缺少包 bash-completion

san*_*ans 16 yum centos dnf

我正在尝试在 CentOS 6 中的 Yum 中使用制表符补全(这样我就可以做类似的事情yum install firefo<TAB>并返回firefox),并且我发现了很多教程都说简单地做yum install bash-completion,但是当我这样做时,我得到了这个:

Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: mirror.anl.gov
 * extras: yum.singlehop.com
 * updates: mirror.ubiquityservers.com
Setting up Install Process
No package bash-completion available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud)

我应该添加一些存储库吗?

Ign*_*ams 14

CentOS 需要启用 EPEL Yum 存储库才能安装 bash-completion 包。

有关详细信息,请参阅https://fedoraproject.org/wiki/EPEL


小智 8

您只需要一个命令即可完成 bash 完成:

yum install epel-release.noarch bash-completion.noarch
Run Code Online (Sandbox Code Playgroud)