16

I am trying to get tab-completion working in Yum in CentOS 6 (so I can do something like yum install firefo<TAB> and get back firefox), and I have found many tutorials which say to simply do yum install bash-completion, but when I do this, I get this back:

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

Is there some repository I should add?

4 Answers 4

14

CentOS needs to have EPEL Yum repository enabled in order to install bash-completion package.

See https://fedoraproject.org/wiki/EPEL for details.

8

There is only one command you have to get bash-completion:

yum install epel-release.noarch bash-completion.noarch
1
4
  1. Download the bash-completion RPM

    wget http://www.caliban.org/files/redhat/RPMS/noarch/bash-completion-20060301-1.noarch.rpm

  2. Install the RPM

    rpm -ivh bash-completion-20060301-1.noarch.rpm

  3. Execute the command

    . /etc/bash_completion

  4. Now you can try the autocompletion

    yum ins — [TAB][TAB]

Edit: for Centos 6, you can grab this RPM

1
  • Installing unsigned packages from untrusted source is huge security risk.
    – gavenkoa
    May 31, 2017 at 10:59
1

If you don't have EPEL installed then first run:

yum install epel-release

Then run the following command:

yum install bash-completion --enablerepo=epel

After installation you have to logout/login in order for it to start working. To start using it in the current session, source it with the . command:

. /etc/bash_completion

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .