Linuxbrew / brew

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

Use wget in install script if curl is not available? #625

Closed breneser closed 6 years ago

breneser commented 6 years ago

To help us debug your issue please explain:

Features

It seems wget is more universally available than curl (or at least a minimal debian installation does not seem to have curl). Would it possible to use wget in install script to fetch content from the net during installation? Maybe try curl if wget is not available ?

I am not sure if this would be beneficial to 90% of the user base, but I think it would be nice to be able to install LinuxBrew on as many different Linux installations as possible with no other depedency.

On servers with no install permissions I would probably have to install curl from source or fetch appropriate binaries, it is kind of against the point of creating this script.

Or maybe there is another way to make it possible ?

sjackman commented 6 years ago

The Debian Docker image debian:latest hash neither curl nor wget installed, interestingly enough.

I agree that it would be a useful feature to bootstrap Linuxbrew on a system without curl using wget. It's not a priority item for me, but I'll add it to my wish list. In the mean time, here's a workaround for you.

cd ~/.cache/Homebrew/
wget https://linuxbrew.bintray.com/bottles/curl-7.58.0.x86_64_linux.bottle.tar.gz
wget https://linuxbrew.bintray.com/bottles/openssl-1.0.2n_1.x86_64_linux.bottle.tar.gz
wget https://linuxbrew.bintray.com/bottles/zlib-1.2.11.x86_64_linux.bottle.tar.gz
brew install curl

I've added a wiki page here: https://github.com/Linuxbrew/brew/wiki/Bootstrap-with-wget

breneser commented 6 years ago

Thanks, didn't know I could download bottles. Still discovering LinuxBrew, great work bringing Brew to Linux 👍

cschou commented 5 years ago

Hi @sjackman , Do you mind elaborating on the workarounds you gave? I still ran into problems... cd ~/.cache/Homebrew/ wget https://linuxbrew.bintray.com/bottles/curl-7.58.0.x86_64_linux.bottle.tar.gz wget https://linuxbrew.bintray.com/bottles/openssl-1.0.2n_1.x86_64_linux.bottle.tar.gz wget https://linuxbrew.bintray.com/bottles/zlib-1.2.11.x86_64_linux.bottle.tar.gz brew install curl

==> Downloading https://linuxbrew.bintray.com/bottles-portable-ruby/portable-ruby-2.3.7.x86_64_linux.bottle.tar.gz /home/jovyan/.linuxbrew/Homebrew/Library/Homebrew/cmd/vendor-install.sh: line 99: curl: command not found ..........

sjackman commented 5 years ago

The work around has unfortunately gotten a bit trickier, since the path to the file in ~/.cache now includes a hash of the url. It's still possible, but unfortunately not easily described here.

Here's the location of the portable-ruby bottle.

https://bintray.com/homebrew/bottles-portable-ruby/download_file?file_path=portable-ruby-2.3.7.x86_64_linux.bottle.tar.gz

Here's the location of the other bottles and their paths on disk including the hash:

$ brew fetch portable-ruby curl openssl zlib
Fetching: portable-ruby, curl, openssl, zlib
==> Downloading https://linuxbrew.bintray.com/bottles-portable-ruby/portable-rub
######################################################################## 100.0%
Downloaded to: /home/linuxbrew/.cache/Homebrew/downloads/aec50b1775bc28b16c6dc92061d1123d8b0467f8951d553582df76197dc1a3bf--portable-ruby-2.3.7.x86_64_linux.bottle.tar.gz
SHA256: 9df214085a0e566a580eea3dd9eab14a2a94930ff74fbf97fb1284e905c8921d
==> Downloading https://curl.haxx.se/download/curl-7.62.0.tar.bz2
Already downloaded: /home/linuxbrew/.cache/Homebrew/downloads/5081c1cc96386bdb3d21033ed453bab98bd8492f2ccf0aea0a75c5f6a5b37ca7--curl-7.62.0.tar.bz2
SHA256: 7802c54076500be500b171fde786258579d60547a3a35b8c5a23d8c88e8f9620
==> Downloading https://www.openssl.org/source/openssl-1.0.2q.tar.gz
Already downloaded: /home/linuxbrew/.cache/Homebrew/downloads/bfd5d14e97371eed56ab875871c8e05eb1db5bc099a6353e46bae830f9bcc8ff--openssl-1.0.2q.tar.gz
SHA256: 5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684
Resource: ca-bundle
==> Downloading https://curl.haxx.se/ca/cacert-2018-10-17.pem
Downloaded to: /home/linuxbrew/.cache/Homebrew/downloads/4574db1b76ab79990cad76018cd407df92dbfd931e83ef62353dc16dc460081a--cacert-2018-10-17.pem
SHA256: 86695b1be9225c3cf882d283f05c944e3aabbc1df6428a4424269a93e997dc65
Resource: cacert
==> Downloading https://curl.haxx.se/ca/cacert-2017-01-18.pem
Already downloaded: /home/linuxbrew/.cache/Homebrew/downloads/8018b4bbbcd02aee7e40b54af7ecd175bc6ac8187a9e711e541316f504595d4d--cacert-2017-01-18.pem
SHA256: e62a07e61e5870effa81b430e1900778943c228bd7da1259dd6a955ee2262b47
==> Downloading https://linuxbrew.bintray.com/bottles/zlib-1.2.11.x86_64_linux.b
Already downloaded: /home/linuxbrew/.cache/Homebrew/downloads/e26d7f94e9190e27f35a0ca17586414d88d5bb82ae7927206a18556eab619109--zlib-1.2.11.x86_64_linux.bottle.tar.gz
SHA256: 6f604280b9e056da163b81cef3076b2e39bbd2b8d3cc8c36d27c19c472c760a4

I'm afraid I won't be able to give you exact instructions as I'm short for time.