⚠ Fixing things - Homebrew cannot find curl

May 09, 22

TL;DR: Install curl with apt

I found myself recently dealing with an unexpected problem after installing Homebrew: it couldn’t find curl, which actually was installed. The installation script in one line that it’s provided on the wesite ran smoothly except during the download of portable ruby. I had to download it manually and paste on the required folder by the installer. This was a first sign that something was going bad, as that download was being executed using curl too.

After the successful installation with my manual patch, I proceeded to check brew and install some libraries. However I found the following issue:

$ brew doctor
Error: Please update your system curl.
Minimum required version: 7.41.0
Your curl version: 
Your curl executable: 
Your system is ready to brew.

Homebrew was asking me to update my system curl (which was already in its latest version) and moreover it wouldn’t tell me which version I had. To be 100% that curl was installed on my Ubuntu 22.04 LTS, I double checked it:

$ curl --version
curl 7.82.0 (x86_64-pc-linux-gnu) libcurl/7.82.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 zstd/1.4.4 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3 libgsasl/1.8.1 OpenLDAP/2.4.49
Release-Date: 2022-03-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli gsasl GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd

The solution

I noticed that my curl binaries were installed by a snap package, probably during my Ubuntu installation. So I decided to try and install curl with apt.

$ sudo apt-get install curl

After the installation, I did check again that curl was working properly and then tried again brew:

$ brew doctor
Your system is ready to brew.

Voilá! That solved my problem.

Now the thing is: this is not an optimal solution. Of course I could delete the curl installation from snap and move to another thing, but I would like to know the root cause of this problem. My guess is that it should be something related to the PATH, probably brew is not getting the snap binaries PATH. As I don’t have much time to investigate it right now, I will leave this post opened and will update it once I find the solution. In any case, I hope the workaround was useful for you if you came here looking for answers to this problem! :sunglasses: