Linuxbrew / brew

:beer::penguin: The Homebrew package manager for Linux
https://linuxbrew.sh
BSD 2-Clause "Simplified" License
2.66k stars 237 forks source link

brew update failed #844

Closed Sartori-RIA closed 6 years ago

Sartori-RIA commented 6 years ago

when i run brew update it show this error:

dev@dev-22:~$ brew update
Initialized empty Git repository in /home/linuxbrew/.linuxbrew/Homebrew/.git/
fatal: unable to access 'https://github.com/Linuxbrew/brew/': error setting certificate verify locations:
  CAfile: /home/linuxbrew/.linuxbrew/etc/openssl/cert.pem
  CApath: /home/linuxbrew/.linuxbrew/etc/openssl/certs
fatal: unable to access 'https://github.com/Linuxbrew/brew/': error setting certificate verify locations:
  CAfile: /home/linuxbrew/.linuxbrew/etc/openssl/cert.pem
  CApath: /home/linuxbrew/.linuxbrew/etc/openssl/certs

i tried reinstalling brew, however it doesn't work as shown below.

dev@dev-22:~$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
curl: (77) error setting certificate verify locations:
  CAfile: /home/linuxbrew/.linuxbrew/etc/openssl/cert.pem
  CApath: /home/linuxbrew/.linuxbrew/etc/openssl/certs
sjackman commented 6 years ago

Please surround copied-and-pasted logs with triple back ticks. See GitHub Help / Quoting Code.

sjackman commented 6 years ago

See if this FAQ entry is helpful: https://github.com/Linuxbrew/brew/wiki/FAQ#why-does-curl-fail

Please report the output of…

brew update-reset
brew postinstall openssl
Sartori-RIA commented 6 years ago

it works for me, however when i run this code

sed -i '/^insecure$/d' ~/.curlrc

git config --global http.sslVerify true

it shows this error:

dev@dev-22:~$ git clone https://github.com/Sartori-RIA/Zombie-Network-JavaFX.git
Cloning into 'Zombie-Network-JavaFX'...
fatal: unable to access 'https://github.com/Sartori-RIA/Zombie-Network-JavaFX.git/': error setting certificate verify locations:
  CAfile: /home/linuxbrew/.linuxbrew/etc/openssl/cert.pem
  CApath: /home/linuxbrew/.linuxbrew/etc/openssl/certs

Any ideias?

sjackman commented 6 years ago

Please report the output of…

brew postinstall openssl
Sartori-RIA commented 6 years ago
dev@dev-22:~$ brew postinstall openssl
==> Postinstalling openssl
==> Downloading https://curl.haxx.se/ca/cacert-2017-01-18.pem

curl: (22) The requested URL returned error: 503
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall openssl`
sjackman commented 6 years ago

Please report the output of which -a curl and

❯❯❯ curl -s https://curl.haxx.se/ca/cacert-2017-01-18.pem | file -
/dev/stdin: UTF-8 Unicode English text
sjackman commented 6 years ago

Try downloading this file https://curl.haxx.se/ca/cacert-2017-01-18.pem by some other means, and move it to the location

/home/linuxbrew/.cache/Homebrew/downloads/6d2f0aa30538560efe2aae756229a9ced40e636a70083696fb1bceb6c1a7564c--openssl-1.0.2p.tar.gz

then run

brew postinstall openssl
sjackman commented 6 years ago

Please also report the output of

brew config
curl --version
openssl version
Sartori-RIA commented 6 years ago

it finally works, i apreciate your help

brew config

dev@dev-22:~$ brew config
HOMEBREW_VERSION: 1.7.3-1-g201dae5
ORIGIN: https://github.com/Linuxbrew/brew
HEAD: 201dae523ecc07f5e30503c1a5f05c362fc2159f
Last commit: 8 days ago
Core tap ORIGIN: https://github.com/Linuxbrew/homebrew-core
Core tap HEAD: 9278740383f1afc2810635f898f5f27df90ea8da
Core tap last commit: 7 hours ago
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_REPOSITORY: /home/linuxbrew/.linuxbrew/Homebrew
HOMEBREW_CELLAR: /home/linuxbrew/.linuxbrew/Cellar
HOMEBREW_CACHE: /home/dev/.cache/Homebrew
HOMEBREW_BOTTLE_DEFAULT_DOMAIN_LINUX: https://linuxbrew.bintray.com
HOMEBREW_BOTTLE_DEFAULT_DOMAIN_MACOS: https://homebrew.bintray.com
HOMEBREW_GIT: git
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
CPU: quad-core 64-bit dunno
Homebrew Ruby: 2.5.1 => /usr/bin/ruby2.5
Clang: N/A
Git: 2.19.0 => /home/linuxbrew/.linuxbrew/bin/git
Curl: 7.58.0 => /usr/bin/curl
Java: N/A
Kernel: Linux 4.15.0-20-generic x86_64 GNU/Linux
OS: Linux Mint 19 Tara (tara)
Host glibc: 2.27
/usr/bin/gcc: 7.3.0
glibc: N/A
gcc: 5.5.0_4
xorg: N/A

curl --version

dev@dev-22:~$ curl --version
curl 7.61.1 (x86_64-pc-linux-gnu) libcurl/7.61.1 OpenSSL/1.0.2p
Release-Date: 2018-09-05
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets HTTPS-proxy 

openssl version

dev@dev-22:~$ openssl version
OpenSSL 1.0.2p  14 Aug 2018
sjackman commented 6 years ago

Glad to hear that work around worked for you! For other that stumble here, the workaround is:

Downloading this file https://curl.haxx.se/ca/cacert-2017-01-18.pem by some other means, and move it to the location:

/home/linuxbrew/.cache/Homebrew/downloads/6d2f0aa30538560efe2aae756229a9ced40e636a70083696fb1bceb6c1a7564c--openssl-1.0.2p.tar.gz

then run

brew postinstall openssl
zfwf commented 6 years ago

I installed homebrew in ~/.brew and I had to download the https://curl.haxx.se/ca/cacert-2017-01-18.pem, place in ~/.brew/etc/openssl/cert.pem (rename to cert.pem), then do brew reinstall curl for curl to work.