I had been using Ubuntu and recently migrated to RedHat.
The apt-get install auto completion is very handy, so I supposed yum install should have this function as well, but seemed it doesn't.
Is there package name tab completion of yum install ?
Asked
Active
Viewed 1,822 times
2 Answers
4
first check that you have the bash_completion package installed;
$ rpm -qa | grep compl
bash-completion-2.1-2.fc18.noarch
If you are on rhel/centos, check that it being sourced in your .bashrc file, like so;
$ cat ~/.bashrc | grep -A3 '\[ -f /etc/bash_completion \]'
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
otherwise bash_completions are loaded from /etc/profile.d on fedora;
$ ls -1 /etc/profile.d/ | grep compl
bash_completion.sh
udisks-bash-completion.sh
to test it, you can manually source the file, and see if it working as you want; (centos/rhel)
$ source /etc/bash_completion
if you are using fedora, you will need this instead;
$ source /etc/profile.d/bash_completion.sh
note:
whether this is the best way to search for installable packages is debatable, but I actually didn't realise you could do this until I just tried....
$ 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
... ...
etc etc
Tom
- 11,346
- 5
- 42
- 63
0
Try running the following:
yum install bash-completion
source /etc/bash_completion
Tom O'Connor
- 27,560
saxieyu
- 1
bash-completionrocks my world. It puts tab completion in all sorts of places, not just here. – Michael Hampton May 30 '13 at 14:50