Linuxbrew / legacy-linuxbrew

:skull: This repository is defunct, because it has been split into https://github.com/Linuxbrew/brew and https://github.com/Linuxbrew/homebrew-core
http://linuxbrew.sh
Other
2.23k stars 297 forks source link

fail to install brew on Debian 8 #1096

Closed w3ntao closed 8 years ago

w3ntao commented 8 years ago

Dependencies installed.

`$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"`
==> This script will install:
/home/rahn/.linuxbrew/bin/brew
/home/rahn/.linuxbrew/Library/...
/home/rahn/.linuxbrew/share/man/man1/brew.1

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
git-remote-https: symbol lookup error: /usr/lib/x86_64-linux-gnu/libhogweed.so.2: undefined symbol: __gmpn_cnd_add_n
Failed during: git fetch origin master:refs/remotes/origin/master -n

`$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"`
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
    rm -rf /home/rahn/.linuxbrew/Cellar /home/rahn/.linuxbrew/.git && brew cleanup

`$ brew`
bash: brew: command not found

Debian 8.4 on Parallels Desktop 11 of MacBook Pro (Retina, late 2013)

sjackman commented 8 years ago

This appears to be a bug in your installation of Debian. See for example http://ubuntuforums.org/showthread.php?t=2258760 Please report:

which -a which git-remote-https
ldd `which git-remote-https`
ldd /usr/lib/x86_64-linux-gnu/libhogweed.so.2
w3ntao commented 8 years ago

Yep, something wrong with my git. After fixing the bug:

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/linuxbrew/go/install)"

==> This script will install:
/home/rahn/.linuxbrew/bin/brew
/home/rahn/.linuxbrew/Library/...
/home/rahn/.linuxbrew/share/man/man1/brew.1

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
remote: Counting objects: 353111, done.
remote: Total 353111 (delta 1), reused 1 (delta 1), pack-reused 353109
Receiving objects: 100% (353111/353111), 68.22 MiB | 330.00 KiB/s, done.
Resolving deltas: 100% (267095/267095), done.
From https://github.com/Homebrew/linuxbrew
 * [new branch]      master     -> origin/master
HEAD is now at dc1c2b5 JavaRequirement: Linuxbrew default_formula "jdk"
Warning: /home/rahn/.linuxbrew/bin is not in your PATH.
==> Installation successful!
==> Next steps
Install the Linuxbrew dependencies:

Debian, Ubuntu, etc.:
  `sudo apt-get install build-essential`

Fedora, Red Hat, CentOS, etc.:
  `sudo yum groupinstall 'Development Tools'`

See http://brew.sh/linuxbrew/#dependencies for more information.

Run `brew doctor` before you install anything
Run `brew help` to get started

$ apt-get install build-essential

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

$ brew

bash: brew: command not found

How do I do for this?

rwhogg commented 8 years ago

Looks like you need /home/rahn/.linuxbrew/bin/ in your path. Can you add it in and try again?

If it's already in your path, you can try either hash -r (Bash) or rehash (Zsh) and then try to run the command again.

w3ntao commented 8 years ago

I get zsh: command not found: brew even I'm at directory /home/rahn/.linuxbrew/bin/

I don't know why.

I'm new to Linux, still google on path editing.

sjackman commented 8 years ago

@tseemann pointed out that this warning gets buried.

Warning: /home/rahn/.linuxbrew/bin is not in your PATH.

It needs to be improved with these instructions: http://linuxbrew.sh/#installation

Add to your .bashrc or .zshrc:

export PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
w3ntao commented 8 years ago

I append export PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH" to the end of ~/.bashrc and terminal prompt:

\ (gedit:2990): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-spell-language not supported

\ (gedit:2990): WARNING **: Set document metadata failed: Setting attribute metadata::gedit-encoding not supported

After saving: $ which brew brew not found

sjackman commented 8 years ago

Open a new terminal window with a new shell. It should work.

w3ntao commented 8 years ago

No, it doesn't... The line has been appended to ~/.bashrc But $PATH remain unchanged. $ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

sjackman commented 8 years ago

Try instead appending the line to ~/.bash_profile

Also try running in the new terminal:

PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
which brew
brew env
w3ntao commented 8 years ago

I don't have a .bash_profile in ~ so gedit create a new one for me. Still: `$ which brew~ brew not found

sjackman commented 8 years ago

Please try:

PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
which brew
brew doctor
w3ntao commented 8 years ago

It works this time but not after starting a new terminal. So there is something wrong with .bashrc?

w3ntao commented 8 years ago

Found it, It's about zsh. I edit .zshrc and everything goes. I thought zsh would inherit config from bash

w3ntao commented 8 years ago

Thanks, @sjackman @rwhogg

tseemann commented 8 years ago

@sjackman @rwhogg We should probably check $SHELL to tell people which dotfile to add the PATH stuff to ?

w3ntao commented 8 years ago

@tseemann @sjackman @rwhogg I think you should.

sjackman commented 8 years ago
echo 'PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"' >> ~/.$(basename $SHELL)rc
$SHELL -c 'brew doctor'

?

tseemann commented 8 years ago

@sjackman pretty much, maybe $HOME/.$(basename ${SHELL:-bash})rc for safety in case $SHELL was undefined... is ~ guaranteed to work in all shells?

sjackman commented 8 years ago

Yep, ~ expands to $HOME on pretty much ever shell that I know of. Only at the start of a word though, not in the middle, so the above $HOME can't be replaced by ~.

❯❯❯ echo ~
/Users/sjackman
❯❯❯ echo PATH=~
PATH=~