Curl command installed for Homebrew is not recognized

Asked 2 years ago, Updated 2 years ago, 352 views

Failed to install brew on xserver.
When I checked the brew doctor to see if it was working properly, the following error occurred:

Error: Please update your system curl.
Minimum required version: 7.41.0
Your curl version: 7.29.0
Your curl executable: /usr/bin/curl
Error: Please update your system Git.
Minimum required version: 2.7.0
Your Git version: 1.8.3.1
Your Git executable: /usr/bin/git

Apparently the curl and Git versions are out of date, so I upgraded the curl version to 7.74.0 and confirmed that the version was actually upgraded.

$~/opt/bin/curl --version
curl7.74.0(x86_64-pc-linux-gnu)libcurl/7.74.0zlib/1.2.7
Release-Date: 2020-12-09
Protocols:dict file ftp gopher http imap mqtt pop3rtsp smtp telnet tftp
Features: alt-svc AsyncDNS Largefile libz UnixSockets

I heard that xserver is forced to refer to the curl of the older version (7.29.0) of the server standard, so I changed the contents of .bash_profile by referring to the following article ·I made it possible to refer to the curl I installed by reflecting the settings in the source.

How do I change my installed Brew to use

The modified .bash_profile is shown below.

 if [-f to /.bashrc]; then
    . ~/.bashrc
fi

PATH=$HOME/opt/bin:$PATH

export PATH
export HOMEBREW_FORCE_BREWED_CURL="1"

However, even if you run brew doctor again, the following error message will be printed and the old version of curl of the xserver will be referenced.

$brew doctor
Error: Please update your system curl.
Minimum required version: 7.41.0
Your curl version: 7.29.0
Your curl executable: /usr/bin/curl
Error: Please update your system Git.
Minimum required version: 2.7.0
Your Git version: 1.8.3.1
Your Git executable: /usr/bin/git
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 work or file an issue; just ignore this.Thanks!

Warning—Some installed formula are decremented or disabled.
You should find replacements for the following formula:
  [email protected]

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure `scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name.We found the following "config" scripts:
  /home/[xserverID]/opt/bin/curl-config

Warning: An updated version (1.8.3.1) 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 encoder build failures with some formula.
Please create pull requests install of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsive for resolution
any issues you experience while you are running this
unsupported configuration.

How can I get a view of the curl that I installed?I would appreciate it if you could let me know.

linux homebrew curl

2022-09-30 21:57

1 Answers

The setting of the environment variable PATH in through /.bash_profile (export PATH=$HOME/opt/bin:$PATH) does not work because PATH is reset inside the brew command (shell script).

brew/brew at master ·Homebrew/brew

 if [[-z"${HOMEBREW_NO_ENV_FILTERING}"]]
then
  PATH="/usr/bin:/bin:/usr/sbin:/sbin"

  FILTERED_ENV=()
  # Filter all but the specific variables.
  For VAR in HOME SHELL PATH...
  do
              :

    FILTERED_ENV+=("${VAR}=${!VAR}")
  done

  exec/usr/bin/env-i "${FILTERED_ENV[@]}"/bin/bash"${HOMEBREW_LIBRARY}/Homebrew/brew.sh""$@"

Next, brew.sh which is executed with the brew command:

brew/brew.sh at master ·Homebrew/brew

if [[-n"${HOMEBREW_FORCE_BREWED_CURL}"&
      -x"${HOMEBREW_PREFIX}/opt/curl/bin/curl"]]&
         "${HOMEBREW_PREFIX}/opt/curl/bin/curl" --version>/dev/null
then
  HOMEBREW_CURL = "${HOMEBREW_PREFIX}/opt/curl/bin/curl"
elif [[-n "${HOMEBREW_DEVELOPER}"&-x "${HOMEBREW_CURL_PATH}"]]]
then
  HOMEBREW_CURL="${HOMEBREW_CURL_PATH}"
else
  HOMEBREW_CURL = "curl"
fi

The curl command has a file path of ~/opt/bin/curl, so HOMEBREW_CURL is set to curl and PATH is reset to "/usr/bin:/bin:/usr/sbin:/sbin"" as the final CUMRE code.

To avoid this and set $HOME/opt/bin/curl to HOMEBREW_CURL, you may want to add the following to ~/.bash_profile.

export HOMEBREW_DEVELOPER=1
export HOMEBREW_CURL_PATH="$HOME/opt/bin/curl"


2022-09-30 21:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.