RedHat – yum安装完成

我一直在使用Ubuntu,并最近迁移到RedHat。
apt-get install自动完成非常方便,所以我认为yum install应该有这个function,但似乎没有。
yum install软件包名称选项卡完成了吗?

首先检查你是否安装了bash_completion包;

 $ rpm -qa | grep compl bash-completion-2.1-2.fc18.noarch 

如果你使用的是rhel / centos,请检查它是否来自你的.bashrc文件,就像这样;

 $ cat ~/.bashrc | grep -A3 '\[ -f /etc/bash_completion \]' if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi 

否则bash_completions从Fedora上的/etc/profile.d加载;

 $ ls -1 /etc/profile.d/ | grep compl bash_completion.sh udisks-bash-completion.sh 

testing它,你可以手动来源文件,看看它是否工作,如你所愿; (centos的/ RHEL)

 $ source /etc/bash_completion 

如果你使用的是Fedora,你将需要这个。

 $ source /etc/profile.d/bash_completion.sh 

注意:

是否这是search可安装软件包的最佳方式是有争议的,但我实际上并没有意识到你可以这样做,直到我刚刚尝试….

 $ yum install Display all 40991 possibilities? (y or n) 0ad-data.noarch 0ad-debuginfo.x86_64 0xFFFF-debuginfo.x86_64 0xFFFF.x86_64 389-admin-console-doc.noarch 389-admin-console.noarch 389-admin-debuginfo.x86_64 389-admin.i686 389-adminutil-debuginfo.x86_64 389-adminutil-devel.i686 389-adminutil-devel.x86_64 389-ds-base-libs.x86_64 389-ds-base.x86_64 389-ds-console-doc.noarch 

……

等等

尝试运行以下内容:

 yum install bash-completion source /etc/bash_completion