Error while trying to install any packages

Hi all,

I am new in this forum and I am trying to use Linuxbrew but so far I have some difficulties, so maybe the community will be able to help me.

1- I have tried --force and also brew update-reset && brew update => no improvement
2- I have checked on github I could find a similar issue but so far what I found didn’t help me.
3- I have checked brew doctor the message didn’t help me at all. I’ll show you below the message obtained from the doctor…

So here is my problem:
I tried to install a newer version of git : brew install git
But git was not installed (and same thing for many other packages, like postgresql or fftw)
In addition, no error message is plot on the terminal.

Here is the obtained message from brew doctor :
Error: undefined methodundent’ for #String:0x0000000002f34060
Please report this issue:
/work/scratch/evanol/.linuxbrew/Library/Homebrew/cmd/doctor.rb:61:in block in doctor /work/scratch/evanol/.linuxbrew/Library/Homebrew/cmd/doctor.rb:53:in each’
/work/scratch/evanol/.linuxbrew/Library/Homebrew/cmd/doctor.rb:53:in doctor' /work/scratch/evanol/.linuxbrew/Library/Homebrew/brew.rb:112:in ’ `

Does anyone know what is wrong ? I spent quite a lot of time on that, and unfortunately so far I have no clue.

Thanks for your help.


EDIT: Below some info from brew config

CPU: 48-core 64-bit broadwell
Homebrew Ruby: 2.6.3 => /work/scratch/evanol/.linuxbrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
Clang: N/A
Git: => /bin/git
Curl: 7.29.0 => /usr/bin/curl
Kernel: Linux 3.10.0-957.12.2.el7.x86_64 x86_64 GNU/Linux
OS: CentOS Linux release 7.6.1810 (Core) (Core)
Host glibc: 2.17
/usr/bin/gcc: 4.8.5
glibc: N/A
gcc: 5.5.0_7
xorg: N/A

Half the lines are missing. What’s the full output of brew config and brew doctor?

Thanks for your reply. My bad, the full output of brew config:
HOMEBREW_VERSION: >=2.2.0 (shallow or no git repository)
HEAD: e93cf6bf4ada337baf21cbbbb99cf3fc03094026
Last commit: 3 days ago
Core tap ORIGIN:
Core tap HEAD: 7b9ea38e96259812a793105666a92ac3c6fec9bf
Core tap last commit: 3 days ago
Core tap branch: master
HOMEBREW_PREFIX: /work/scratch/evanol/.linuxbrew
HOMEBREW_REPOSITORY: /work/scratch/evanol/.linuxbrew
HOMEBREW_CELLAR: /work/scratch/evanol/.linuxbrew/Cellar
HOMEBREW_DISPLAY: localhost:15.0
CPU: 48-core 64-bit broadwell
Homebrew Ruby: 2.6.3 => /work/scratch/evanol/.linuxbrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
Clang: N/A
Git: => /bin/git
Curl: 7.29.0 => /usr/bin/curl
Kernel: Linux 3.10.0-957.12.2.el7.x86_64 x86_64 GNU/Linux
OS: CentOS Linux release 7.6.1810 (Core) (Core)
Host glibc: 2.17
/usr/bin/gcc: 4.8.5
glibc: N/A
gcc: 5.5.0_7
xorg: N/A

The full output of brew doctor:
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don’t worry or file an issue; just ignore this. Thanks!

Warning: An outdated version ( of Git was detected in your PATH.
Git 2.7.0 or newer is required for Homebrew.
Please upgrade:
brew install git

Warning: Your Homebrew’s prefix is not /home/linuxbrew/.linuxbrew.
Some of Homebrew’s bottles (binary packages) can only be used with the default
prefix (/home/linuxbrew/.linuxbrew).
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew’s GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this unsupported configuration.

Error: undefined method undent' for #<String:0x0000000003d51918> Please report this issue: /work/scratch/evanol/.linuxbrew/Library/Homebrew/extend/os/linux/diagnostic.rb:41:in check_tmpdir_executable’
/work/scratch/evanol/.linuxbrew/Library/Homebrew/cmd/doctor.rb:61:in block in doctor' /work/scratch/evanol/.linuxbrew/Library/Homebrew/cmd/doctor.rb:53:in each’
/work/scratch/evanol/.linuxbrew/Library/Homebrew/cmd/doctor.rb:53:in doctor' /work/scratch/evanol/.linuxbrew/Library/Homebrew/brew.rb:112:in

My system git is outdated that is why I am trying to install a new version of git via Linuxbrew. But it does not work. Otherwise is there a way to specify to linuxbrew another path for git instead of the system path ?

Thank you for the bug report, Lory. I’ve opened PR to resolve your issue. Instead of crashing in this way, it should have printed the warning…

          The directory #{HOMEBREW_TEMP} does not permit executing
          programs. It is likely mounted as "noexec". Please set HOMEBREW_TEMP
          in your #{shell_profile} to a different directory, for example:
            export HOMEBREW_TEMP=~/tmp
            echo 'export HOMEBREW_TEMP=~/tmp' >> #{shell_profile}

where HOMEBREW_TEMP is likely /tmp for most systems.

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like util-linux.
Another possible workaround for you is brew install --force-bottle util-linux, but no promises.

If it’s an option for you, you could open a ticket with your information systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew.

The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below. On macOS the default installation directory is /usr/local. On Linux the default installation directory is /home/linuxbrew/.linuxbrew.

My PR to fix this issue has been merged, and it will be included in the next release of Homebrew. Thanks again for the bug report.

Hi @sjackman, thanks for your reply. I don’t think I can install linuxbrew in /home/linuxbrew and i think it won’t be an option in the futur.

I have a last question to make things clearer in my mind.
The question concerns the installation in the default location (/home/linuxbrew). For the case of a cluster with several users, if a user A decides to modify the formula of a package by adding some custom parameters, for instance by specifying a mpi library for hdf5, then if another user decides to install hdf5, he will have the customed hdf5 of user A transparently, without knowing that user A has changed the homebrew core formula. The core formula has been updated by user A, am I right ?
Unless user A renames the edited formula so that the homebrew-core formula won’t be affected.

Another alternative might be to create his own tap stored localy with his own edited formula. But anyway he must change the name of the formula, otherwise we might have conflict in the symlink in /home/linuxbrew/Cellar. Am I right ?

Yes, on a multi-user system, where each user wants to be able to run brew, it’s best that each user have their own installation in their home directory. Alternatively, you could provide one installation shared by all users, but those users do not have direct access to the brew command. There is also a homebrew/brew Docker image, if that’s helpful.

Thanks @sjackman, it’s clearer now. Cheers ! :beer:

1 Like