macOS 10.15 brew Error: mariadb@10.3 has been disabled because it is not supported upstream! 异常解决方法

在macOS 10.15中使用brew安装mariadb@10.3时会提示已经被禁止,原因是上游不支持. 这个是因为目前苹果对10.15版本的系统已经不再支持导致. 

异常信息:

brew install mariadb@10.3
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/api/formula.jws.jso
#=#=#                                                                          
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/api/cask.jws.json
#=#=#                                                                          
Warning: You are using macOS 10.15.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

Error: mariadb@10.3 has been disabled because it is not supported upstream!

解决方法1: 直接改用 macport包管理工具

这个方法就很简单了, 直接使用以下命令安装即可,前提是你已经安装了macport, 安装方法见:  macos MacPort 包管理工具安装和使用-CSDN博客

sudo port install mariadb-10.3

注意: port 里面的软件包的命名规则和brew稍有不同,port里面是 mariadb-10.3 而brew里面是 mariadb@10.3

解决方法2: 编辑本地的tap,将禁用那个提示注释

直接执行以下命令即可,注意如果你本地没有clone过tap参考源码,这个命令会自动全量克隆源码

HOMEBREW_NO_INSTALL_FROM_API=1 brew install mariadb@10.3

手动浅克隆homebrew-core taps源码

当然,如果你不想全量克隆brew core源码,可以手动浅克隆(既在git clone时 指定--depth=1参数)

# 浅克隆 --depth=1 
# 指定克隆的地址为 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
# 
git clone --depth=1 https://mirrors.ustc.edu.cn/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core

注意:

1. 上面的 /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core 这个是brew默认读取本地homebrew-core 这个tap的路径,只能是这个,否则不生效!

2. 阿里的brew加速地址在git clone时没有进度,貌似不能使用git clone访问,所以换成ustc的镜像

3. 如果需要使用 brew services 命令来管理安装的应用的服务,则必须要使用全量克隆! 

使用brew edit 命令编辑本地tap 

直接使用命令 brew edit  mariadb@10.3 就可以打开指定的tap进行编辑, 如下:

最后的效果

注意, 使用 brew edit  xxx 这个命令的前提是你必须要配置HOMEBREW_EDITOR环境变量 , 如:vscode编辑器命令行工具:  

export HOMEBREW_EDITOR="/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"

编辑完成,保存后再次使用以下命令进行安装

HOMEBREW_NO_INSTALL_FROM_API=1 brew install mariadb@10.3

注意这里的 HOMEBREW_NO_INSTALL_FROM_API=1  临时环境变量是指定brew使用本地taps, 如果不指定就会使用api中的taps, 那样的话你的本地修改就没有作用了!!!

再次执行brew命令后的截图

如果不出意外,这次就可以正常安装brew禁用的软件包 mairadb@10.3 了.

最终结果,如果出现下面的界面表示安装成功!

mairadb@10.3 服务环境配置

将上面的提示信息加入到 ~/.bash_profile


###### mariadb
# 启动服务: brew services start mariadb@10.3
# 
export PATH="/usr/local/opt/mariadb@10.3/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/mariadb@10.3/lib"
export CPPFLAGS="-I/usr/local/opt/mariadb@10.3/include"
export PKG_CONFIG_PATH="/usr/local/opt/mariadb@10.3/lib/pkgconfig"

source ~/.bash_profile  生效环境配置

mairadb@10.3 自定义数据库文件存储路径

brew安装的mariadb的datadir目录定义是在 安装路径中的 .plist 文件中定义,这个和linux里面的是不同的哦!

自定义数据库存储路径: 安装文件夹下的.plist文件和.service中修改 datadir 
使用编辑器打开文件  /usr/local/Cellar/mariadb@10.3/homebrew.mxcl.mariadb@10.3.plist

然后将默认的 datadir路径 /usr/local/var/mysql  修改为你自己想要的路径即可, 如:  /Users/xxx/opt/mariadb@10.3/data

设置完成后执行命令  brew services start mariadb@10.3  即可成功启动mariadb服务

总结:   brew安装已经禁用的软件包稍微复杂, 非brew情怀还是禁用大家使用macport这个包管理工具来安装吧,这个针对旧版本的macos有专门的优化和相关的port入口, 很多brew里面无法安装的旧版本软件包在这个里面都可以顺利的安装,如 xz, python, maridb等

附 brew install mariadb@10.3 完整安装日志

这个日志记录了brew编译安装mariadb@10.3的步骤和使用配置等信息, 对于后期问题的排查和定义具有很重要的意义!

 ~ % HOMEBREW_NO_INSTALL_FROM_API=1 brew install mariadb@10.3
Error: 
  homebrew-core is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
Warning: You are using macOS 10.15.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.

==> Fetching dependencies for mariadb@10.3: bison, cmake, mecab, mecab-ipadic, msgpack, groonga and openssl@1.1
==> Fetching bison
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bison-3.8.2.catalina.bottle.tar.gz
Already downloaded: /Users/MyMac/Library/Caches/Homebrew/downloads/25f37e908ca3ea2d632e3d0da5f686db451e42291a1270dd16817c0fd67a09d3--bison-3.8.2.catalina.bottle.tar.gz
==> Fetching cmake
==> Downloading https://github.com/Kitware/CMake/releases/download/v3.30.2/cmake-3.30.2.tar.gz
Already downloaded: /Users/MyMac/Library/Caches/Homebrew/downloads/4c665536aee664903c7c08ee838466021d3268019762ebf00cef54715ba8f045--cmake-3.30.2.tar.gz
==> Fetching mecab
==> Downloading https://deb.debian.org/debian/pool/main/m/mecab/mecab_0.996.orig.tar.gz
Already downloaded: /Users/MyMac/Library/Caches/Homebrew/downloads/687bcdf54ee2f790b6106b0bfa91c765e01f4915079cc283cd5dc26d3eedfa4c--mecab_0.996.orig.tar.gz
==> Fetching mecab-ipadic
==> Downloading https://deb.debian.org/debian/pool/main/m/mecab-ipadic/mecab-ipadic_2.7.0-20070801+main.orig.tar.gz
Already downloaded: /Users/MyMac/Library/Caches/Homebrew/downloads/6a8b854995b6681d2487b6b4fb697ea235156fef40d08372b63dc252af6d0d1a--mecab-ipadic_2.7.0-20070801+main.orig.tar.gz
==> Fetching msgpack
==> Downloading https://github.com/msgpack/msgpack-c/releases/download/c-6.1.0/msgpack-c-6.1.0.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/4879511/77a81aef-35e8-493d-8d5
######################################################################################################################### 100.0%
==> Fetching groonga
==> Downloading https://packages.groonga.org/source/groonga-normalizer-mysql/groonga-normalizer-mysql-1.2.1.tar.gz
######################################################################################################################### 100.0%
==> Downloading https://github.com/groonga/groonga/releases/download/v14.0.6/groonga-14.0.6.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/107202/ee211065-c88b-4b4c-a63e
######################################################################################################################### 100.0%
Warning: openssl@1.1 has been deprecated because it is not supported upstream!
==> Fetching openssl@1.1
==> Downloading https://www.openssl.org/source/openssl-1.1.1w.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/7634677/b4c6e1f3-d928-4de0-a50
######################################################################################################################### 100.0%
==> Fetching mariadb@10.3
==> Downloading https://archive.mariadb.org/mariadb-10.3.39/source/mariadb-10.3.39.tar.gz
######################################################################################################################### 100.0%
==> Installing dependencies for mariadb@10.3: bison, cmake, mecab, mecab-ipadic, msgpack, groonga and openssl@1.1
==> Installing mariadb@10.3 dependency: bison
==> Pouring bison-3.8.2.catalina.bottle.tar.gz
🍺  /usr/local/Cellar/bison/3.8.2: 99 files, 3.7MB
==> Installing mariadb@10.3 dependency: cmake
==> ./bootstrap --prefix=/usr/local/Cellar/cmake/3.30.2 --no-system-libs --parallel=8 --datadir=/share/cmake --docdir=/share/doc
==> make
==> make install
🍺  /usr/local/Cellar/cmake/3.30.2: 3,423 files, 61.2MB, built in 13 minutes 55 seconds
==> Installing mariadb@10.3 dependency: mecab
==> ./configure --sysconfdir=/usr/local/etc
==> make install
🍺  /usr/local/Cellar/mecab/0.996: 17 files, 4.4MB, built in 43 seconds
==> Installing mariadb@10.3 dependency: mecab-ipadic
==> ./configure --with-charset=utf8 --with-dicdir=/usr/local/Cellar/mecab-ipadic/2.7.0-20070801/lib/mecab/dic/ipadic
==> make install
🍺  /usr/local/Cellar/mecab-ipadic/2.7.0-20070801: 14 files, 50.6MB, built in 7 seconds
==> Installing mariadb@10.3 dependency: msgpack
==> cmake -S . -B build -DMSGPACK_BUILD_TESTS=OFF
==> cmake --build build
==> cmake --install build
🍺  /usr/local/Cellar/msgpack/6.1.0: 38 files, 222.1KB, built in 5 seconds
==> Installing mariadb@10.3 dependency: groonga
==> ../configure --disable-zeromq --disable-apache-arrow --with-luajit=no --with-ssl --with-zlib --without-libstemmer --with-mec
==> make install
==> ./configure
==> make
==> make install
🍺  /usr/local/Cellar/groonga/14.0.6: 901 files, 86.1MB, built in 3 minutes 25 seconds
==> Installing mariadb@10.3 dependency: openssl@1.1
==> perl ./Configure --prefix=/usr/local/Cellar/openssl@1.1/1.1.1w --openssldir=/usr/local/etc/openssl@1.1 no-ssl3 no-ssl3-metho
==> make
==> make install MANDIR=/usr/local/Cellar/openssl@1.1/1.1.1w/share/man MANSUFFIX=ssl
==> make test
🍺  /usr/local/Cellar/openssl@1.1/1.1.1w: 8,094 files, 18.5MB, built in 5 minutes 3 seconds
==> Installing mariadb@10.3
==> cmake -S . -B _build -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_INCLUDEDIR=include/mysql -DINSTALL_MANDIR=share/man -DIN
==> cmake --build _build
==> cmake --install _build
==> /usr/local/Cellar/mariadb@10.3/10.3.39/bin/mysql_install_db --verbose --user=tekin --basedir=/usr/local/Cellar/mariadb@10.3/
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

MySQL is configured to only allow connections from localhost by default

To connect:
    mysql -uroot

mariadb@10.3 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have mariadb@10.3 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/mariadb@10.3/bin:$PATH"' >> ~/.zshrc

For compilers to find mariadb@10.3 you may need to set:
  export LDFLAGS="-L/usr/local/opt/mariadb@10.3/lib"
  export CPPFLAGS="-I/usr/local/opt/mariadb@10.3/include"

For pkg-config to find mariadb@10.3 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/mariadb@10.3/lib/pkgconfig"

To start mariadb@10.3 now and restart at login:
  brew services start mariadb@10.3
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/mariadb@10.3/bin/mysqld_safe --datadir\=/usr/local/var/mysql
==> Summary
🍺  /usr/local/Cellar/mariadb@10.3/10.3.39: 660 files, 171.5MB, built in 9 minutes 48 seconds
==> Running `brew cleanup mariadb@10.3`...
==> Caveats
==> mariadb@10.3
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

MySQL is configured to only allow connections from localhost by default

To connect:
    mysql -uroot

mariadb@10.3 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have mariadb@10.3 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/mariadb@10.3/bin:$PATH"' >> ~/.zshrc

For compilers to find mariadb@10.3 you may need to set:
  export LDFLAGS="-L/usr/local/opt/mariadb@10.3/lib"
  export CPPFLAGS="-I/usr/local/opt/mariadb@10.3/include"

For pkg-config to find mariadb@10.3 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/mariadb@10.3/lib/pkgconfig"

To start mariadb@10.3 now and restart at login:
  brew services start mariadb@10.3
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/mariadb@10.3/bin/mysqld_safe --datadir\=/usr/local/var/mysql

遇到 "CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'" 这样的错误,通常意味着在当前的终端会话中,Conda 并未正确设置环境激活命令。这可能是由于以下几个原因: 1. **Shell配置问题**:你需要确保在你的系统中,无论是 Bash、Zsh、Fish 还是其他shell,都已经正确安装了 Conda 并配置了 `conda` 的路径。 2. **`~/.bashrc` 或 `.bash_profile` 文件**:检查这些文件中是否有正确的 Conda 配置。你需要添加类似 `export PATH=.../anaconda3/bin:$PATH` 的行,确保 `conda` 命令可以在任何目录下被找到。 3. **Shell启动脚本**:有些操作系统可能会有默认的shell启动脚本(如 macOS 的 `.zshrc` 或 `.bash_profile`),确认这些脚本是否包含了 Conda 的初始化设置。 4. **非默认的shell**:如果你使用的是非默认的shell(如 Fish),记得在相应的配置文件中更新环境激活命令。 为了解决这个问题,你可以尝试以下步骤: - **重新加载shell配置**:运行 `source ~/.bashrc` 或 `source ~/.bash_profile`(根据你的shell)。 - **手动添加路径**:直接将 `anaconda3` 的 bin 目录添加到系统的 PATH 变量中。 - **检查并修复环境变量**:确保 `CONDA_PREFIX` 和 `CONDA_HOME` 环境变量指向了正确的位置。 - **重新初始化或创建新的shell session**:关闭当前的终端会话,然后打开一个新的终端看看问题是否解决。 如果以上步骤还不能解决问题,可能需要查看Conda的官方文档或者寻求社区支持,比如Stack Overflow,以获得更具体的操作指南。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值