Homebrew / install

📥 Homebrew (un)installer
https://brew.sh
BSD 2-Clause "Simplified" License
2.15k stars 1.02k forks source link

Linux install stuck (Debian Trixie) #830

Closed alfonsocv12 closed 9 months ago

alfonsocv12 commented 9 months ago

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

What you were trying to do (and why)

I was trying to install homebrew on my Linux computer, the reason is to have the same version of some programs as my mac systems, Debian apt moves a lot slower than homebrew

What happened (include command output)

I ran the official script this script

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Command output
    ```
    ==> Checking for `sudo` access (which may request your password)...
    ```
  

What you expected to happen

Get homebrew installed

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

I just have Debian Trixie system (Testing branch of Debian 12)

Bo98 commented 9 months ago

Have a check of https://github.com/Homebrew/install/blob/3d2b88baf18424b561766fcdac31be06553e0e07/install.sh#L222-L254 and see if you can find what part is hanging for you.

Typical flow would be /usr/bin/sudo -v && /usr/bin/sudo -l mkdir

alfonsocv12 commented 9 months ago

Okay I run that it asked my password and then get stuck here is my script

#!/bin/bash

have_sudo_access() {
  if [[ ! -x "/usr/bin/sudo" ]]
  then
    return 1
  fi

  local -a SUDO=("/usr/bin/sudo")
  if [[ -n "${SUDO_ASKPASS-}" ]]
  then
    SUDO+=("-A")
  elif [[ -n "${NONINTERACTIVE-}" ]]
  then
    SUDO+=("-n")
  fi

  if [[ -z "${HAVE_SUDO_ACCESS-}" ]]
  then
    if [[ -n "${NONINTERACTIVE-}" ]]
    then
      "${SUDO[@]}" -l mkdir &>/dev/null
    else
      "${SUDO[@]}" -v && "${SUDO[@]}" -l mkdir &>/dev/null
    fi
    HAVE_SUDO_ACCESS="$?"
  fi

  if [[ -n "${HOMEBREW_ON_MACOS-}" ]] && [[ "${HAVE_SUDO_ACCESS}" -ne 0 ]]
  then
    abort "Need sudo access on macOS (e.g. the user ${USER} needs to be an Administrator)!"
  fi

  return "${HAVE_SUDO_ACCESS}"
}

have_sudo=$(have_sudo_access)

echo "Response $have_sudo"
Screenshot 2023-12-14 at 4 47 57 PM
alfonsocv12 commented 9 months ago

If I put the wrong password I get re-prompted

Screenshot 2023-12-14 at 5 06 26 PM
alfonsocv12 commented 9 months ago

I found the problem is the -l in line 243 of the installer

Stuck

"${SUDO[@]}" -v && "${SUDO[@]}" -l mkdir &>/dev/null

No Stuck

"${SUDO[@]}" -v && "${SUDO[@]}" mkdir &>/dev/null
alfonsocv12 commented 9 months ago

I downloaded the installation script fix the -l and try again still getting stuck

MikeMcQuaid commented 9 months ago

If you need more help: please open a discussion.

osalbahr commented 9 months ago

I just have Debian Trixie system (Testing branch of Debian 12)

FWIW, the prompt works fine in a docker run -it debian:testing container. It might help to see if the issue happens on a proper fresh install rather than a container.

osalbahr@ad93086274c7:~$ brew dr
Your system is ready to brew.
osalbahr@ad93086274c7:~$ brew config
HOMEBREW_VERSION: 4.1.25
ORIGIN: https://github.com/Homebrew/brew
HEAD: c32bd1c7cc0c3b1b914845bddfeda53f4d877a3f
Last commit: 8 days ago
Core tap JSON: 15 Dec 09:56 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 3.1.4 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: quad-core 64-bit skylake
Clang: N/A
Git: 2.43.0 => /bin/git
Curl: 8.4.0 => /bin/curl
Kernel: Linux 6.5.11-linuxkit x86_64 GNU/Linux
OS: Debian GNU/Linux trixie/sid
Host glibc: 2.37
/usr/bin/gcc: 13.2.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A