tar: Error opening archive: Failed to open ‘/Users/zwq/Library/Caches/Homebrew/downloads/990bc2c8843

问题

使用 homebrew 安装Nginx出现以下错误:

AntonyZhang:~ zwq$ brew install nginx
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pcre-8.45.mojave.bottle.tar.gz
==> Downloading from https://homebrew.bintray.com/bottles/pcre-8.45.mojave.bottle.tar.gz

curl: (22) The requested URL returned error: 403 Forbidden
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/manifests/8.45
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/blobs/sha256:a42b79956773d18c4ac337868cfc15fadadf5e779d65c12ffd6f8fd379b5514
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a42b79956773d18c4ac337868cfc15fadadf5e779d65c
######################################################################## 100.0%
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/nginx-1.21.1.mojave.bottle.tar.gz
==> Downloading from https://homebrew.bintray.com/bottles/nginx-1.21.1.mojave.bottle.tar.gz

curl: (22) The requested URL returned error: 403 Forbidden
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/nginx/manifests/1.21.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/nginx/blobs/sha256:51c2b45dce74a294f53a04eb51be7e1aa63101b72018bb38648b5161e6b8d0
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:51c2b45dce74a294f53a04eb51be7e1aa63101b72018b
######################################################################## 100.0%
==> Installing dependencies for nginx: pcre
==> Installing nginx dependency: pcre
==> Pouring pcre-8.45.mojave.bottle.tar.gz
tar: Error opening archive: Failed to open '/Users/zwq/Library/Caches/Homebrew/downloads/990bc2c88435d66a1dd78451b41fd73dbade409d5a615c90d2640ccd2479e3a8--pcre-8.45.mojave.bottle.tar.gz'
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/zwq/Library/Caches/Homebrew/downloads/990bc2c88435d66a1dd78451b41fd73dbade409d5a615c90d2640ccd2479e3a8--pcre-8.45.mojave.bottle.tar.gz --directory /private/tmp/d20210815-23893-1tv8c6g` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/zwq/Library/Caches/Homebrew/downloads/990bc2c88435d66a1dd78451b41fd73dbade409d5a615c90d2640ccd2479e3a8--pcre-8.45.mojave.bottle.tar.gz'

原因:
pcre没有安装成功,需要手动先安装这个前置依赖
在这里插入图片描述

解决方案

1. 先安装pcre
AntonyZhang:~ zwq$ brew install pcre
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/pcre-8.45.mojave.bottle.tar.gz
==> Downloading from https://homebrew.bintray.com/bottles/pcre-8.45.mojave.bottle.tar.gz

curl: (22) The requested URL returned error: 403 Forbidden
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/manifests/8.45
Already downloaded: /Users/zwq/Library/Caches/Homebrew/downloads/4a3bba0e8d1899c13ac3442d2c49df6c1999948bdc0943f2f179693257d82545--pcre-8.45.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/pcre/blobs/sha256:a42b79956773d18c4ac337868cfc15fadadf5e779d65c12ffd6f8fd379b5514
Already downloaded: /Users/zwq/Library/Caches/Homebrew/downloads/456b31dd91116840800d9cc2f35c6f2ebde8cfe8513e6d08dd6974f3309dc4f9--pcre--8.45.mojave.bottle.tar.gz
==> Pouring pcre--8.45.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/pcre/8.45: 204 files, 5.5MB
2. 再次重新安装Nginx
AntonyZhang:~ zwq$ brew install nginx
==> Downloading https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles/nginx-1.21.1.mojave.bottle.tar.gz
==> Downloading from https://homebrew.bintray.com/bottles/nginx-1.21.1.mojave.bottle.tar.gz

curl: (22) The requested URL returned error: 403 Forbidden
Warning: Bottle missing, falling back to the default domain...
==> Downloading https://ghcr.io/v2/homebrew/core/nginx/manifests/1.21.1
Already downloaded: /Users/zwq/Library/Caches/Homebrew/downloads/4d8faa3c372bac248958100a83a897c816954e5082dbc1c58825b6015f50cb62--nginx-1.21.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/nginx/blobs/sha256:51c2b45dce74a294f53a04eb51be7e1aa63101b72018bb38648b5161e6b8d0
Already downloaded: /Users/zwq/Library/Caches/Homebrew/downloads/39d7df008cc50d3b210bf837506888f3d7bdeae7ea87e77acfe51046dac723d9--nginx--1.21.1.mojave.bottle.tar.gz
==> Pouring nginx--1.21.1.mojave.bottle.tar.gz
==> Caveats
Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that
nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/.

To have launchd start nginx now and restart at login:
  brew services start nginx
Or, if you don't want/need a background service you can just run:
  nginx
==> Summary
🍺  /usr/local/Cellar/nginx/1.21.1: 25 files, 2.2MB
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值