Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

Linuxbrew: "Package bash-completion was not found..." at command prompt. #46

Closed
villimagg opened this issue Jan 6, 2014 · 23 comments
Closed
Assignees
Labels

Comments

@villimagg
Copy link

I'm prompted with this error message when I open terminal in Fedora 20:

"Package bash-completion was not found in the pkg-config search path.
Perhaps you should add the directory containing `bash-completion.pc'
to the PKG_CONFIG_PATH environment variable
No package 'bash-completion' found
bash: /yum: No such file or directory"

I have isolated the problem and it is most definitely connected to Linuxbrew.

Please tell me what ever information is required for solving this.

Thank you.

@sjackman
Copy link
Member

sjackman commented Jan 6, 2014

Is the formula bash-completion installed? If you remove the package bash-completion, does the error go away?

brew remove bash-completion

@villimagg
Copy link
Author

The formula bash-completion was installed and removing it didn't fix it. Other formulas installed were autoconf, libyaml, pkg-config, and ruby-build. I removed all of them an rebooted and then the error message disappeared.

Will try installing pkg-config again and see what happens. If it is connected to that formula. It might be a bug with pkg-config since in the error message "Package bash-completion was not found in the pkg-config search path."

@villimagg
Copy link
Author

I can confirm that the bug is related to the formula pkg-config. Reinstalling pkg-config and rebooting resulted in the same error message as before when I open the terminal. Only now the formula bash-completion was not installed as it was before although the same error message appeared back then when bash-completion was installed.

@sjackman
Copy link
Member

sjackman commented Jan 7, 2014

That's pretty strange. Can you post your .bashrc and .bash_profile in a gist?

@villimagg
Copy link
Author

Here is the gist: https://gist.github.com/villimagg/8293858

@villimagg
Copy link
Author

Ok.. so pkg-config came as a dependency with ruby-build which I installed along with rbenv. bash-completion came as a dependency with rbenv.

The original error message say's:

"Package bash-completion was not found in the pkg-config search path.
Perhaps you should add the directory containing `bash-completion.pc'
to the PKG_CONFIG_PATH environment variable
No package 'bash-completion' found
bash: /yum: No such file or directory"

Which must mean that anyone can add the path to bash-completion to the PKG_CONFIG_PATH environment variable within pkg-config ?

And now I've been searching where I can add the bash-completion path to the PKG_CONFIG_PATH and I have no idea.

@sjackman
Copy link
Member

sjackman commented Jan 7, 2014

I don't see that rbenv has any build dependencies.

➜  ~  brew deps rbenv     
➜  ~  brew deps ruby-build
autoconf
openssl
pkg-config
➜  ~  

@villimagg
Copy link
Author

Thanks for the link. I'll take a look at it.

Here is the output when running brew install rbenv ruby-build:

$ brew install rbenv ruby-build
==> Downloading https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz
Already downloaded: /home/vmag/.cache/Homebrew/rbenv-0.4.0.tar.gz
==> Caveats
To use Homebrew's directories rather than ~/.rbenv add to your profile:
  export RBENV_ROOT=/home/vmag/.linuxbrew/var/rbenv

To enable shims and autocompletion add to your profile:
  if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
==> Summary
/home/vmag/.linuxbrew/Cellar/rbenv/0.4.0: 31 files, 164K, built in 2 seconds
==> Installing dependencies for ruby-build: autoconf, pkg-config, libyaml
==> Installing ruby-build dependency: autoconf
==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
Already downloaded: /home/vmag/.cache/Homebrew/autoconf-2.69.tar.gz
==> ./configure --prefix=/home/vmag/.linuxbrew/Cellar/autoconf/2.69
==> make install
==> Caveats
This formula is keg-only, so it was not symlinked into /home/vmag/.linuxbrew.

Xcode (up to and including 4.2) provides (a rather old) Autoconf.
==> Summary
/home/vmag/.linuxbrew/Cellar/autoconf/2.69: 65 files, 2.1M, built in 2 seconds
==> Installing ruby-build dependency: pkg-config
==> Downloading http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
Already downloaded: /home/vmag/.cache/Homebrew/pkg-config-0.28.tar.gz
==> ./configure --prefix=/home/vmag/.linuxbrew/Cellar/pkg-config/0.28 --disable-host-tool --with-internal-glib --with-pc-path=/home/
==> make
==> make check
==> make install
/home/vmag/.linuxbrew/Cellar/pkg-config/0.28: 10 files, 644K, built in 22 seconds
==> Installing ruby-build dependency: libyaml
==> Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
Already downloaded: /home/vmag/.cache/Homebrew/libyaml-0.1.4.tar.gz
==> ./configure --prefix=/home/vmag/.linuxbrew/Cellar/libyaml/0.1.4
==> make install
/home/vmag/.linuxbrew/Cellar/libyaml/0.1.4: 7 files, 344K, built in 6 seconds
==> Installing ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/archive/v20131122.1.tar.gz
Already downloaded: /home/vmag/.cache/Homebrew/ruby-build-20131122.1.tar.gz
==> ./install.sh
/home/vmag/.linuxbrew/Cellar/ruby-build/20131122.1: 96 files, 440K, built in 2 seconds

pkg-config comes as a dependency for ruby-build and then after running brew install rbenv ruby-build my terminal starts complaining about bash-completion.

@sjackman sjackman removed their assignment Mar 20, 2014
@sjackman
Copy link
Member

Unable to reproduce.

@sjackman sjackman self-assigned this Jun 11, 2014
@gawbul
Copy link
Contributor

gawbul commented May 14, 2015

I'm having the same issue. I needed to install pkg-config for another package (it is a depend of makedepend which was required for openssl) and have been getting the same error:

Package bash-completion was not found in the pkg-config search path.
Perhaps you should add the directory containing `bash-completion.pc'
to the PKG_CONFIG_PATH environment variable
No package 'bash-completion' found
bash: /yum: No such file or directory

@sjackman
Copy link
Member

@gawbul Do you have bash-completion installed? brew list --versions bash-completion

@gawbul
Copy link
Contributor

gawbul commented May 15, 2015

@sjackman tried it both with and without bash-completion installed.

When installed I get:

$ brew list --versions bash-completion
bash-completion 1.3

@gawbul
Copy link
Contributor

gawbul commented May 15, 2015

Doing a find ~/ -name "bash-completion.pc" doesn't find the bash-completion.pc file?

@sjackman
Copy link
Member

bash-completion doesn't appear to install bash-completion.pc.

❯❯❯ brew list bash-completion |grep -c 'pc$'
0

@sjackman
Copy link
Member

I bet that your .bashrc or .bash_profile uses pkg-config to set up bash-completion and that fails if the PKG_CONFIG_PATH is changed to not include that search directory. Linuxbrew does change the PKG_CONFIG_PATH when it's building software. I would recommend hard-coding the path to bash-completion.pc in your BASH startup file.

@gawbul
Copy link
Contributor

gawbul commented May 16, 2015

Hard coded into .bashrc and that worked, thanks 👍

@sjackman
Copy link
Member

Grand. Thanks for the feedback.

@blitzter
Copy link

Hi @gawbul ,
I'm getting the exact same issue in my Fedora 22 machine.
What exactly was added to .bashrc as bash-completion.pc is not really there.

Can you please provide the addition to .bashrc so I and possibly others can fix the issue?

@gawbul
Copy link
Contributor

gawbul commented Jul 12, 2015

Hi @blitzter. I did the following:

[smoss@bioserva ~]$ locate bash-completion.pc
/usr/share/pkgconfig/bash-completion.pc

So I added export PKG_CONFIG_PATH=/usr/share/pkgconfig:$PKG_CONFIG_PATH to my .bashrc.

@blitzter
Copy link

Thanks @gawbul ,
The error message is gone if the line mentioned above is added on top of .bashrc (before /etc/bashrc processing).

@gawbul
Copy link
Contributor

gawbul commented Jul 22, 2015

Sorry, @blitzter, yes, I added it to the top of my .bashrc!

mklabs referenced this issue in yeoman/yo May 9, 2016
@Osndok
Copy link

Osndok commented Jun 15, 2017

I've started getting this message too (in a VM that is also using Fedora 20).

I understand where the message is being generated, from a stock fedora package ("yum-utils"):

$ grep -n pkg-config /etc/bash_completion.d/yum-utils.bash 
2:type -t _yum >/dev/null || . $(pkg-config --variable=completionsdir bash-completion)/yum

As I understand it, this message is "switched on" when a linuxbrew "pkg-config" binary is preferentially used over (earlier in the PATH than) the stock one by the yum-utils package in fedora.

So, then... ignoring the workaround for a moment... isn't the root issue either:

  1. that linuxbrew pkg-config should be bottled (if it does not work for in the more general system-wide use), or
  2. that linuxbrew pkg-config should also loop-in system package definitions by default (or as a fallback? if it is intended to replace the stock pkg-config)

?

@sjackman
Copy link
Member

that linuxbrew pkg-config should be bottled

I think perhaps you mean keg_only. You can brew unlink pkg-config if you like.

that linuxbrew pkg-config should also loop-in system package definitions by default

We explicitly do not include system pkg-config files to avoid using system host libraries unintended, which may conflict with Linuxbrew libraries. You can modify your PKG_CONFIG_PATH to use both.

Neither of these workarounds is a clear win as both of these solutions have their own downsides.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants