天天看點

Homebrew安裝報錯Error: postgresql: Invalid bottle tag symbol1.問題概述2.解決方案

1.問題概述

MacOS上使用Homebrew安裝postgres時報錯

安裝指令:brew install postgres

報錯資訊:Error: postgresql: Invalid bottle tag symbol。

2.解決方案

使用指令:brew edit postgres,打開postgres的formula:

class Postgresql < Formula
  desc "Object-relational database system"
  homepage "https://www.postgresql.org/"
  url "https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2"
  sha256 "ad1dcc4c4fc500786b745635a9e1eba950195ce20b8913f50345bb7d5369b5de"
  revision 1
  head "https://github.com/postgres/postgres.git"

  <其他配置...>  

  bottle do
    sha256 arm64_monterey: "fe137ea6536535299a666ea9e126e84fd58712d25c7071073bb4053da70ad2f0"
    sha256 arm64_big_sur:  "b0a1686c5c5ba668e78a97d66567e9d007f7d2a0c9b1a53e79841e3736d729e6"
    sha256 monterey:       "d40731741ca7d7b16b791fa31d21baab674720c87c00adbf54ca796ff80b9b0f"
  end

  <其他配置...>
           

将bottle do和end及其之間的内容删除,結果如下:

class Postgresql < Formula
  desc "Object-relational database system"
  homepage "https://www.postgresql.org/"
  url "https://ftp.postgresql.org/pub/source/v12.2/postgresql-12.2.tar.bz2"
  sha256 "ad1dcc4c4fc500786b745635a9e1eba950195ce20b8913f50345bb7d5369b5de"
  revision 1
  head "https://github.com/postgres/postgres.git"

  <其他配置...>  

  <其他配置...>
           

退出時,記得wq。

重新執行安裝指令:brew install postgres 即可。