Child pages
  • Linuxbrew
Skip to end of metadata
Go to start of metadata

Linuxbrew is a system of installing open source applications into a user's home directory. It was derived from Homebrew which was developed for OSX. This may be an easy way to install certain applications that are otherwise complicated to install under Centos. Many applications are built from source, some are pre-built binaries, these packages are called bottles. Enabling repositories uses the tap command.

References:  https://www.ostechnix.com/linuxbrew-common-package-manager-linux-mac-os-x/


Install procedure for RHEL7 or Centos7

for compile and fenn This install should take about 30 minutes.

1] download the linuxbrew installer

This will create a new directory called linuxbrew_install

git clone https://github.com/Linuxbrew/install linuxbrew_install

examine the script at


./linuxbrew_install/install


It should be the same as found at:

https://raw.githubusercontent.com/Linuxbrew/install/master/install

2] run the installer script

Now run the installer script:


./linuxbrew_install/install 


Note: on godel.vcu.edu use qrsh to get a shell on a compute node before running this script.

The installer should have output similar to the following:


$ git clone https://github.com/Linuxbrew/install linuxbrew_install 
Cloning into 'linuxbrew_install'...
remote: Counting objects: 683, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 683 (delta 0), reused 1 (delta 0), pack-reused 680
Receiving objects: 100% (683/683), 151.60 KiB | 0 bytes/s, done.
Resolving deltas: 100% (330/330), done.
[cgchildr@compile ~]$ ./linuxbrew_install/install
==> Select the Linuxbrew installation directory
- Enter your password to install to /home/linuxbrew/.linuxbrew (recommended)
- Press Control-D to install to /home/cgchildr/.linuxbrew
- Press Control-C to cancel installation
Sorry, user cgchildr may not run sudo on compile.
==> This script will install:
/home/cgchildr/.linuxbrew/bin/brew
/home/cgchildr/.linuxbrew/share/doc/homebrew
/home/cgchildr/.linuxbrew/share/man/man1/brew.1
/home/cgchildr/.linuxbrew/share/zsh/site-functions/_brew
/home/cgchildr/.linuxbrew/etc/bash_completion.d/brew
/home/cgchildr/.cache/Homebrew/
/home/cgchildr/.linuxbrew/Homebrew
==> The following new directories will be created:
/home/cgchildr/.linuxbrew/Cellar
/home/cgchildr/.linuxbrew/Homebrew
/home/cgchildr/.linuxbrew/bin
/home/cgchildr/.linuxbrew/etc
/home/cgchildr/.linuxbrew/include
/home/cgchildr/.linuxbrew/lib
/home/cgchildr/.linuxbrew/opt
/home/cgchildr/.linuxbrew/sbin
/home/cgchildr/.linuxbrew/share
/home/cgchildr/.linuxbrew/share/zsh
/home/cgchildr/.linuxbrew/share/zsh/site-functions
/home/cgchildr/.linuxbrew/var
Press RETURN to continue or any other key to abort
==> /bin/mkdir -p /home/cgchildr/.linuxbrew
==> /bin/chown cgchildr:cgchildr /home/cgchildr/.linuxbrew
==> /bin/mkdir -p /home/cgchildr/.linuxbrew/Cellar /home/cgchildr/.linuxbrew/Homebrew /home/cgchildr/.linuxbrew/bin /home/cgchildr/.linuxbrew/etc /home/cgchildr/.linuxbrew/include /home/cgchildr/.linuxbrew/lib /home/cgchildr/.linuxbrew/opt /home/cgchildr/.linuxbrew/sbin /home/cgchildr/.linuxbrew/share /home/cgchildr/.linuxbrew/share/zsh /home/cgchildr/.linuxbrew/share/zsh/site-functions /home/cgchildr/.linuxbrew/var
==> /bin/chmod g+rwx /home/cgchildr/.linuxbrew/Cellar /home/cgchildr/.linuxbrew/Homebrew /home/cgchildr/.linuxbrew/bin /home/cgchildr/.linuxbrew/etc /home/cgchildr/.linuxbrew/include /home/cgchildr/.linuxbrew/lib /home/cgchildr/.linuxbrew/opt /home/cgchildr/.linuxbrew/sbin /home/cgchildr/.linuxbrew/share /home/cgchildr/.linuxbrew/share/zsh /home/cgchildr/.linuxbrew/share/zsh/site-functions /home/cgchildr/.linuxbrew/var
==> /bin/chmod 755 /home/cgchildr/.linuxbrew/share/zsh /home/cgchildr/.linuxbrew/share/zsh/site-functions
==> /bin/chown cgchildr /home/cgchildr/.linuxbrew/Cellar /home/cgchildr/.linuxbrew/Homebrew /home/cgchildr/.linuxbrew/bin /home/cgchildr/.linuxbrew/etc /home/cgchildr/.linuxbrew/include /home/cgchildr/.linuxbrew/lib /home/cgchildr/.linuxbrew/opt /home/cgchildr/.linuxbrew/sbin /home/cgchildr/.linuxbrew/share /home/cgchildr/.linuxbrew/share/zsh /home/cgchildr/.linuxbrew/share/zsh/site-functions /home/cgchildr/.linuxbrew/var
==> /bin/chgrp cgchildr /home/cgchildr/.linuxbrew/Cellar /home/cgchildr/.linuxbrew/Homebrew /home/cgchildr/.linuxbrew/bin /home/cgchildr/.linuxbrew/etc /home/cgchildr/.linuxbrew/include /home/cgchildr/.linuxbrew/lib /home/cgchildr/.linuxbrew/opt /home/cgchildr/.linuxbrew/sbin /home/cgchildr/.linuxbrew/share /home/cgchildr/.linuxbrew/share/zsh /home/cgchildr/.linuxbrew/share/zsh/site-functions /home/cgchildr/.linuxbrew/var
==> Downloading and installing Linuxbrew...
remote: Counting objects: 104849, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 104849 (delta 1), reused 0 (delta 0), pack-reused 104847
Receiving objects: 100% (104849/104849), 23.63 MiB | 15.91 MiB/s, done.
Resolving deltas: 100% (76405/76405), done.
From https://github.com/Linuxbrew/brew
* [new branch] master -> origin/master
* [new tag] 1.0.0 -> 1.0.0
* [new tag] 1.0.1 -> 1.0.1
* [new tag] 1.0.2 -> 1.0.2
* [new tag] 1.0.3 -> 1.0.3
* [new tag] 1.0.4 -> 1.0.4
* [new tag] 1.0.5 -> 1.0.5
* [new tag] 1.0.6 -> 1.0.6
* [new tag] 1.0.7 -> 1.0.7
* [new tag] 1.0.8 -> 1.0.8
* [new tag] 1.0.9 -> 1.0.9
* [new tag] 1.1.0 -> 1.1.0
* [new tag] 1.1.0.1 -> 1.1.0.1
* [new tag] 1.1.1 -> 1.1.1
* [new tag] 1.1.10 -> 1.1.10
* [new tag] 1.1.11 -> 1.1.11
* [new tag] 1.1.12 -> 1.1.12
* [new tag] 1.1.13 -> 1.1.13
* [new tag] 1.1.2 -> 1.1.2
* [new tag] 1.1.2.1 -> 1.1.2.1
* [new tag] 1.1.3 -> 1.1.3
* [new tag] 1.1.4 -> 1.1.4
* [new tag] 1.1.5 -> 1.1.5
* [new tag] 1.1.6 -> 1.1.6
* [new tag] 1.1.7 -> 1.1.7
* [new tag] 1.1.8 -> 1.1.8
* [new tag] 1.1.9 -> 1.1.9
* [new tag] 1.2.0 -> 1.2.0
* [new tag] 1.2.1 -> 1.2.1
* [new tag] 1.2.2 -> 1.2.2
* [new tag] 1.2.3 -> 1.2.3
* [new tag] 1.2.4 -> 1.2.4
* [new tag] 1.2.5 -> 1.2.5
* [new tag] 1.2.6 -> 1.2.6
* [new tag] 1.2.7 -> 1.2.7
* [new tag] 1.2.8 -> 1.2.8
* [new tag] 1.3.0 -> 1.3.0
* [new tag] 1.3.1 -> 1.3.1
* [new tag] 1.3.2 -> 1.3.2
* [new tag] 1.3.3 -> 1.3.3
* [new tag] 1.3.4 -> 1.3.4
* [new tag] 1.3.5 -> 1.3.5
* [new tag] 1.3.6 -> 1.3.6
* [new tag] 1.3.7 -> 1.3.7
* [new tag] 1.3.8 -> 1.3.8
* [new tag] 1.3.9 -> 1.3.9
* [new tag] 1.4.0 -> 1.4.0
* [new tag] 1.4.1 -> 1.4.1
* [new tag] 1.4.2 -> 1.4.2
* [new tag] 1.4.3 -> 1.4.3
* [new tag] 1.5.0 -> 1.5.0
* [new tag] 1.5.1 -> 1.5.1
HEAD is now at 8ccb999 test.rb: Add python to PATH in test env
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz
==> Tapping homebrew/core
Cloning into '/home/cgchildr/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4688, done.
remote: Compressing objects: 100% (4490/4490), done.
remote: Total 4688 (delta 49), reused 344 (delta 11), pack-reused 0
Receiving objects: 100% (4688/4688), 3.95 MiB | 1.78 MiB/s, done.
Resolving deltas: 100% (49/49), done.
Tapped 4480 formulae (4,728 files, 12.4MB)
Already up-to-date.
==> Installation successful!
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics.html
==> Next steps:
- Install the Linuxbrew dependencies if you have sudo access:
Debian, Ubuntu, etc.
sudo apt-get install build-essential
Fedora, Red Hat, CentOS, etc.
sudo yum groupinstall 'Development Tools'
See http://linuxbrew.sh/#dependencies for more information.
- Add Linuxbrew to your ~/.profile by running
echo 'export PATH="/home/cgchildr/.linuxbrew/bin:$PATH"' >>~/.profile
echo 'export MANPATH="/home/cgchildr/.linuxbrew/share/man:$MANPATH"' >>~/.profile
echo 'export INFOPATH="/home/cgchildr/.linuxbrew/share/info:$INFOPATH"' >>~/.profile
- Add Linuxbrew to your PATH
PATH="/home/cgchildr/.linuxbrew/bin:$PATH"
- We recommend that you install GCC by running:
brew install gcc
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
Warning: /home/cgchildr/.linuxbrew/bin is not in your PATH.




To uninstall this linuxbrew installation run:

 
./linuxbrew_install/uninstall 


To install linuxbrew in a location other than ~/.linuxbrew  ( like a
shared directory with other users )  Edit the installer script and
change the directory for the variable HOMEBREW_PREFIX 

3] Environmental Variables 

If you append the path in your  .bash_profile as instructed in the install script output (above) the linuxbrew environment will run every time you log in. Among other thing this changes the default compiler to the one used by linuxbrew. If you don't want to do this, create a file with the environmental variables and then manually run it any time you want to use the programs installed by linuxbrew.
Create a new file in your home directory called ~/enable_linuxbrew.sh and add the following environmental variables:



export HOMEBREW_PREFIX="${HOME}/.linuxbrew"
export HOMEBREW_CELLAR="${HOME}/.linuxbrew/Cellar"
export HOMEBREW_REPOSITORY="${HOME}/.linuxbrew/Homebrew"
export PATH="${HOME}/.linuxbrew/bin:${HOME}/.linuxbrew/sbin:$PATH"
export MANPATH="${HOME}/.linuxbrew/share/man:$MANPATH"
export INFOPATH="${HOME}/.linuxbrew/share/info:$INFOPATH"
# uncomment below to turn off brew analytics
# https://docs.brew.sh/Analytics.html
#export HOMEBREW_NO_ANALYTICS=1



Then source the file to enable these variables:

source ~/enable_linuxbrew.sh

To verify these varibles have been set, you should see them show up when
you run this command:

 
env | grep -i brew 

4] First install of linuxbrew package

Use linuxbrew to install the program "hello" This is the hello world program written in C and requires the installation of the compilers and libraries that will be used for other packages.

Following the theme of fermented beverages, Linuxbrew packages are called "bottles"

brew install hello


The output of this installation should look like this:


$ brew install hello
==> Installing dependencies for hello: patchelf, xz, zlib, binutils, linux-headers, glibc, m4, gmp, mpfr, libmpc, isl, gcc
==> Installing hello dependency: patchelf
==> Downloading https://linuxbrew.bintray.com/bottles/patchelf-0.9_1.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring patchelf-0.9_1.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/patchelf/0.9_1: 6 files, 1.2MB
==> Installing hello dependency: xz
==> Downloading https://linuxbrew.bintray.com/bottles/xz-5.2.3.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring xz-5.2.3.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/xz/5.2.3: 99 files, 1.8MB
==> Installing hello dependency: zlib
==> Downloading https://linuxbrew.bintray.com/bottles/zlib-1.2.11.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring zlib-1.2.11.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/zlib/1.2.11: 12 files, 423.5KB
==> Installing hello dependency: binutils
==> Downloading https://ftp.gnu.org/gnu/binutils/binutils-2.30.tar.gz
######################################################################## 100.0%
==> ./configure --with-sysroot=/ --enable-deterministic-archives --prefix=/home/cgchildr/.linuxbrew/Cellar/binutils/2.30 --infodir=/home/cgchildr/.linuxbrew/Cellar
==> make
==> make install
==> strip /home/cgchildr/.linuxbrew/Cellar/binutils/2.30/bin/sysdump /home/cgchildr/.linuxbrew/Cellar/binutils/2.30/bin/readelf /home/cgchildr/.linuxbrew/Cellar/bin
🍺 /home/cgchildr/.linuxbrew/Cellar/binutils/2.30: 5,002 files, 221.9MB, built in 3 minutes 29 seconds
==> Installing hello dependency: linux-headers
==> Downloading https://linuxbrew.bintray.com/bottles/linux-headers-4.4.80.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring linux-headers-4.4.80.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/linux-headers/4.4.80: 772 files, 3.7MB
==> Installing hello dependency: glibc
==> Downloading https://ftp.gnu.org/gnu/glibc/glibc-2.23.tar.gz
######################################################################## 100.0%
==> ../configure --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=/home/cgchildr/.linuxbrew/Cellar/glibc/2.23 --enable-obsolete-rpc --w
==> make
==> make install
==> Installing locale data for en_US.UTF-8
==> /home/cgchildr/.linuxbrew/Cellar/glibc/2.23/bin/localedef -i en_US -f UTF-8 en_US.UTF-8
🍺 /home/cgchildr/.linuxbrew/Cellar/glibc/2.23: 1,418 files, 90.2MB, built in 5 minutes 26 seconds
==> Installing hello dependency: m4
==> Downloading https://linuxbrew.bintray.com/bottles/m4-1.4.18.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring m4-1.4.18.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/m4/1.4.18: 13 files, 1.1MB
==> Installing hello dependency: gmp
==> Downloading https://linuxbrew.bintray.com/bottles/gmp-6.1.2_1.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gmp-6.1.2_1.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/gmp/6.1.2_1: 20 files, 3.8MB
==> Installing hello dependency: mpfr
==> Downloading https://linuxbrew.bintray.com/bottles/mpfr-4.0.1.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mpfr-4.0.1.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/mpfr/4.0.1: 29 files, 10.4MB
==> Installing hello dependency: libmpc
==> Downloading https://linuxbrew.bintray.com/bottles/libmpc-1.1.0.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libmpc-1.1.0.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/libmpc/1.1.0: 13 files, 1.5MB
==> Installing hello dependency: isl
==> Downloading https://linuxbrew.bintray.com/bottles/isl-0.18.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring isl-0.18.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/isl/0.18: 81 files, 6.4MB
==> Installing hello dependency: gcc
==> Downloading https://linuxbrew.bintray.com/bottles/gcc-5.5.0_1.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gcc-5.5.0_1.x86_64_linux.bottle.tar.gz
==> Creating the GCC specs file: /home/cgchildr/.linuxbrew/Cellar/gcc/5.5.0_1/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.5.0/specs
🍺 /home/cgchildr/.linuxbrew/Cellar/gcc/5.5.0_1: 1,361 files, 164.7MB
==> Installing hello
==> Downloading https://linuxbrew.bintray.com/bottles/hello-2.10.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring hello-2.10.x86_64_linux.bottle.tar.gz
🍺 /home/cgchildr/.linuxbrew/Cellar/hello/2.10: 52 files, 595.6KB

Once hello has been install you should be able to run it:

[cgchildr@compile ~]$ which hello
~/.linuxbrew/bin/hello

[cgchildr@compile ~]$ hello
Hello, world!

5] Turn off linuxbrew analytics (optional)


brew analytics off





Install procedure for RHEL6 or Centos6

Now a separate wiki page, see: 

Install Linuxbrew on RHEL6 or Centos6


Using Linuxbrew to install applications

Install Linuxbrew Scientific Software repository


Much of the scientific software is under the "homebrew science"
repository. To add a repository, use the "tap" command:


brew tap homebrew/science 


Most linuxbrew scientific packages were once located in the homebrew/science repository, but that has been discontinued and they are now being incorporated into the main repository. Not all packages and dependencies are reconciled. Errors may occur.


https://discourse.brew.sh/t/homebrew-science-consider-changing-deprecated-to-discontinued/1508/2

https://github.com/Homebrew/homebrew-science/issues/6617

https://twitter.com/brew_sci


brew tap brewsci/bio
brew tap brewsci/science
brew untap homebrew/science



Use this command to search for packages:

 
brew search <package>

Use this command to install packages.
 
brew install <package>


See the list of all packages in the science repository:

http://www.braumeister.org/repos/Homebrew/homebrew-science/browse/a


Troubleshooting


1] First make sure linuxbrew is up to date

run these commands:


brew update
brew update
brew doctor


2] Downloading errors

This is usually caused by an older version of curl


==> Downloading https://www.cpan.org/src/5.0/perl-5.26.1.tar.xz
curl: (35) SSL connect error
Error: Failed to download resource "perl"
Download failed: https://www.cpan.org/src/5.0/perl-5.26.1.tar.xz


Work-around: use wget to download file into expected directory


wget https://www.cpan.org/src/5.0/perl-5.26.1.tar.xz $HOME/.cache/Homebrew/


3]  dependency was built with different library 

Warning: bowtie2 dependency berkeley-db was built with a different C++ standard
library (libstdc++ from gcc-4.8). This may cause problems at runtime.


brew remove bowtie2
HOMEBREW_BUILD_FROM_SOURCE=1 brew install bowtie2


If the package can not be removed due to being the dependency of another package, do a force removal, followed by an install from source:


brew uninstall --ignore-dependencies pcre
HOMEBREW_BUILD_FROM_SOURCE=1 brew install pcre



4] Rename or remove the following directories, then redo installation:

As a last resort, remove the existing install in order to re-install from scratch. Remove the following directories:

~/.linuxbrew 
~/linuxbrew-install
~/.cache/Homebrew

5] Read the Troubleshooting Checklist.




  • No labels
{"serverDuration": 79, "requestCorrelationId": "52b8118b7efb0046"}View graphic versionView graphic versionView graphic version