koalaman / shellcheck

ShellCheck, a static analysis tool for shell scripts
https://www.shellcheck.net
GNU General Public License v3.0
35.55k stars 1.74k forks source link

Cannot install shellcheck via brew #2229

Closed qgaye closed 3 years ago

qgaye commented 3 years ago

when I run brew install shellcheck the program throw ERROR Failed to download resource "shellcheck_bottle_manifest"

image

if I directly visit https://ghcr.io/v2/homebrew/core/shellcheck/manifests/0.7.1-1 it show UNAUTHORIZED

image

GhostLyrics commented 3 years ago

@qgaye Update homebrew and try again, the latest shellcheck version available as of this comment is 0.7.2.

shinokada commented 3 years ago

I have the same problem. I updated the brew.

$ brew install shellcheck
Error: shellcheck: no bottle available!
You can try to install from source with:
  brew install --build-from-source shellcheck
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

image

My macOS has Apple M1.

XiaobenLi00 commented 3 years ago

@shinokada I have the same problem as you have and I haven't fixed it.

shinokada commented 3 years ago

ghc 8.8 may be a lost cause for Apple Silicon.

GHC is a Haskell and when I tried brew install cabal-install, it has the same problem.

image

GhostLyrics commented 3 years ago

Are you on a M1 based mac?

shinokada commented 3 years ago

Yes.

shinokada commented 3 years ago

It's not ideal but thanks for having an online shellcheck. I use https://www.shellcheck.net/. I just wait until it's updated. I don't recommend the M1 chip yet, because a quite few important apps are not working, like Docker.

JackonYang commented 3 years ago

@GhostLyrics's solution works for me, I'm using M1 chip.

here is the output:

Screen Shot 2021-06-05 at 11 46 04

what did I do

run brew update as below.

Screen Shot 2021-06-05 at 11 50 51

there is no output for a while, I killed the process and run brew install shellcheck. it works

shinokada commented 3 years ago

@JackonYang In your screenshot you have Errors. I don't think you installed it. I updated and upgraded brew, but I still get an error.

image

JackonYang commented 3 years ago

@shinokada

it works as you can see. there might be something wrong with your environment.

Screen Shot 2021-06-05 at 13 18 21
shinokada commented 3 years ago

I got the mac two weeks ago. Are these OS and version the same as yours?

image

bhrutledge commented 3 years ago

I think this might be a duplicate of #2162, because you've got an M1 MacBook, and shellcheck doesn't natively support Apple Silicon yet. I posted a workaround in https://github.com/koalaman/shellcheck/issues/2162#issuecomment-855405285.

dasl- commented 3 years ago

It works now installing shellcheck with homebrew on M1 without rosetta:

% brew install shellcheck
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
at-spi2-atk                       libmobi                           maturin                           mongocli                          sqlbench                          tmuxp
==> Updated Formulae
Updated 224 formulae.
==> Renamed Formulae
grakn -> typedb
==> New Casks
kubenav               landrop               macstroke             p4                    prisma-studio         suuntodm5             universal-battle      wolfram-player        yippy
==> Updated Casks
Updated 135 casks.
==> Deleted Casks
crypt                                                               gitbox                                                              touch-bar-pong

==> Downloading https://ghcr.io/v2/homebrew/core/shellcheck/manifests/0.7.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/shellcheck/blobs/sha256:8844cd2a84bd07f8697463d9af3cc41cc4356edfa11d1171255884dc732ee9cd
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:8844cd2a84bd07f8697463d9af3cc41cc4356edfa11d1171255884dc732ee9cd?se=2021-06-10T16%3A15%3A00Z&sig=bjs71%2F1JETvtvGbD21D1
######################################################################## 100.0%
==> Pouring shellcheck--0.7.2.arm64_big_sur.bottle.tar.gz
🍺  /opt/homebrew/Cellar/shellcheck/0.7.2: 7 files, 68.8MB
shinokada commented 3 years ago

@dasl- Thanks. It works.

qgaye commented 3 years ago

@qgaye Update homebrew and try again, the latest shellcheck version available as of this comment is 0.7.2.

after update homwbrew, it works.