Skip to content

bash-completion@2: Completions are not working on linux #229901

@buonhobo

Description

@buonhobo

brew gist-logs <formula> link OR brew config AND brew doctor output

❯ brew config
HOMEBREW_VERSION: 4.5.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 700d67a85e0129ab8a893ff69246943479e33df1
Last commit: 6 days ago
Branch: stable
Core tap JSON: 13 Jul 09:09 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_EDITOR: /usr/bin/nano
HOMEBREW_MAKE_JOBS: 24
Homebrew Ruby: 3.4.4 => /var/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.4.4/bin/ruby
CPU: 24-core 64-bit zen5
Clang: N/A
Git: 2.50.1 => /bin/git
Curl: 8.11.1 => /bin/curl
Kernel: Linux 6.15.5-200.fc42.x86_64 x86_64 GNU/Linux
OS: Fedora Linux 42.20250713.0 (Kinoite)
Host glibc: 2.41
/usr/bin/gcc: N/A
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: 15.1.0
xorg: N/A

❯ brew doctor
Warning: No developer tools installed.
Install Clang or run `brew install gcc`.

I DID install gcc using brew, as you can see from `brew config`. I guess there is another linux bug that prevents it from detecting the gcc installation...

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I was trying to get bash completions for packages installed using brew

What happened (include all command output)?

Completions are not working

What did you expect to happen?

Completions should work

Step-by-step reproduction instructions (by running brew commands)

I ran `brew install bash-completion@2` and I added the required line to my `.bash_profile`.

I even tried rebooting and completions are not loaded.
When debugging this, I found out that the script that gets called is `/home/linuxbrew/.linuxbrew/etc/profile.d/bash_completion.sh` and there is a check inside it that fails every time.

The check is `"x${BASH_COMPLETION_VERSINFO-}" = x` which always fails because `BASH_COMPLETION_VERSINFO` is always set to 2 on my computer.

I managed to get it working by adding `unset BASH_COMPLETION_VERSINFO` before the line I added to `.bash_profile`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions