7rikazhexde’s tech log

技術的な興味関心、備忘録、アウトプットなどを書いています。

brew doctorでopenssl@1.1が警告表示される(deprecated)現象と解決方法について

要約

  • brew doctoropenssl@1.1が非推奨と警告が表示されたので対応しました。
  • 参考記事を元にperlを更新しましたが、警告表示は変わらなかったため、依存関係を確認してexpectを再インストールすることで対応しました。

注意事項

  • 以下は利用環境に依存しますので参考記事も確認して慎重に実行してください。
  • 最新のperlを使用することについてはデメリットはないと思いますが、自己責任でお願いします。(openssl@1.1アンインストール時のエラー出力を確認してください。)
  • homebrewで管理していないコマンドも影響を受ける可能性があるので注意してください。(多くのコマンドはopenssl@3に対応してると思いますが。)

実行環境

% sw_vers
ProductName:        macOS
ProductVersion:     13.6.1
BuildVersion:       22G313

% brew --version
Homebrew 4.1.17

現象

openssl@1.1deprecatedと表示されていました。

% brew update
Already up-to-date.
% brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  openssl@1.1

公式

formulae.brew.sh

対応

参考記事を元にperlのインストールとopenssl@1.1のアンインストールを実施

参考記事:

qiita.com

qiita.com

% perl --version

This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Copyright 1987-2020, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

% type perl
perl is /usr/bin/perl

% brew install perl
==> Downloading https://formulae.brew.sh/api/formula.jws.json

==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/perl/manifests/5.38.0
######################################################################### 100.0%
==> Fetching dependencies for perl: berkeley-db
==> Downloading https://ghcr.io/v2/homebrew/core/berkeley-db/manifests/18.1.40_2
######################################################################### 100.0%
==> Fetching berkeley-db
==> Downloading https://ghcr.io/v2/homebrew/core/berkeley-db/blobs/sha256:a6b047
######################################################################### 100.0%
==> Fetching perl
==> Downloading https://ghcr.io/v2/homebrew/core/perl/blobs/sha256:db18bcd070562
######################################################################### 100.0%
==> Installing dependencies for perl: berkeley-db
==> Installing perl dependency: berkeley-db
==> Downloading https://ghcr.io/v2/homebrew/core/berkeley-db/manifests/18.1.40_2
Already downloaded: $HOME/Library/Caches/Homebrew/downloads/dad399d41acac3c682869c3c11caa898079e60cc1336af2d7ec80b5538bddfb6--berkeley-db-18.1.40_2.bottle_manifest.json
==> Pouring berkeley-db--18.1.40_2.ventura.bottle.tar.gz
🍺  /usr/local/Cellar/berkeley-db/18.1.40_2: 44 files, 5.9MB
==> Installing perl
==> Pouring perl--5.38.0.ventura.bottle.tar.gz
==> Caveats
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.

You can set that up like this:
  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
And add the following to your shell profile e.g. ~/.profile or ~/.zshrc
  eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"
==> Summary
🍺  /usr/local/Cellar/perl/5.38.0: 2,504 files, 67.8MB
==> Running `brew cleanup perl`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> perl
By default non-brewed cpan modules are installed to the Cellar. If you wish
for your modules to persist across updates we recommend using `local::lib`.

You can set that up like this:
  PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
And add the following to your shell profile e.g. ~/.profile or ~/.zshrc
  eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"

perlのインストール後にバージョン確認

% perl --version

This is perl 5, version 38, subversion 0 (v5.38.0) built for darwin-thread-multi-2level

Copyright 1987-2023, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

% type perl
perl is /usr/local/bin/perl

openssl@1.1を強制的に削除する

% brew uninstall --ignore-dependencies openssl@1.1
Uninstalling /usr/local/Cellar/openssl@1.1/1.1.1w... (8,101 files, 18.5MB)

Warning: The following openssl@1.1 configuration files have not been removed!
If desired, remove them manually with `rm -rf`:
  /usr/local/etc/openssl@1.1
  /usr/local/etc/openssl@1.1/cert.pem
  /usr/local/etc/openssl@1.1/ct_log_list.cnf
  /usr/local/etc/openssl@1.1/ct_log_list.cnf.dist
  /usr/local/etc/openssl@1.1/misc
  /usr/local/etc/openssl@1.1/misc/CA.pl
  /usr/local/etc/openssl@1.1/misc/tsget
  /usr/local/etc/openssl@1.1/misc/tsget.default
  /usr/local/etc/openssl@1.1/misc/tsget.pl
  /usr/local/etc/openssl@1.1/misc/tsget.pl.default
  /usr/local/etc/openssl@1.1/openssl.cnf
  /usr/local/etc/openssl@1.1/openssl.cnf.dist

Warning: The following may be openssl@1.1 configuration files and have not been removed!
If desired, remove them manually with `rm -rf`:
  /usr/local/etc/openssl
  /usr/local/etc/openssl@3

openssl@1.1関連のファイルは記載の通り削除しました。

rm -rf /usr/local/etc/openssl@1.1

<補足>openssl@1.1の代替について

opensslを確認するとopenssl@3がインストールされていました。
ログは記録し忘れましたが、openssl@1.1openssl@3がインストールされていました。
openssl@1.1は削除していたのでopenssl@3のみ表示されています。

 % brew list -1 | grep openssl*
openssl@3

openssl@1.1以外に公開されているopensslは以下でした。

formulae.brew.sh

formulae.brew.sh

差異がわからなかったので、差異とインストールについてchatgptで確認しました。
以下の差異があるようです。(2023/10/26時点)

したがって、どちらをインストールするかは、あなたが使用するアプリケーションやシステムの要件によります。一部のアプリケーションは特定のバージョンのOpenSSLを必要とする場合があります。そのため、それらのアプリケーションがopenssl@3.0に依存している場合は、openssl@3.0をインストールすることをお勧めします。しかし、最新の機能やセキュリティ更新を利用するためには、openssl@3(現在のバージョン3.1.3)をインストールすることをお勧めします。

私の環境ではopenssl@3を使用し、openssl@3.0は使用しない(追加インストールはしない)ことにしました。

再度brew doctorを実行するもopenssl@1.1に依存ありの警告が表示される

ここまでで警告表示は解消されると思いましたが消えませんでした。

% brew doctor 
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
  brew install openssl@1.1

Run `brew missing` for more details.

brew missingコマンドを実行して依存関係を確認する

記載の通り依存関係を確認しました。 実行結果はexpectのみでした。

Run `brew missing` for more details.
% brew missing
expect: openssl@1.1

念の為、brew usesコマンドでopenssl@1.1に依存するパッケージを探す

実行結果はexpectのみでした。

% brew uses --installed openssl@1.1                    
expect

openssl@1.1がインスートされていることを確認する

expectはhomebrewでインストールされていました。

% brew list -1 | grep expect
expect

expectを更新する

念の為、更新有無を確認します。

% brew upgrade expect 
Warning: expect 5.45.4_2 already installed

expectを再インストールする

最新ですが念の為再インストールします。これは不要かもしれません。

% brew reinstall expect
==> Downloading https://ghcr.io/v2/homebrew/core/expect/manifests/5.45.4_2-2
######################################################################### 100.0%
==> Fetching expect
==> Downloading https://ghcr.io/v2/homebrew/core/expect/blobs/sha256:25d93f37370
######################################################################### 100.0%
==> Reinstalling expect 
==> Pouring expect--5.45.4_2.ventura.bottle.2.tar.gz
🍺  /usr/local/Cellar/expect/5.45.4_2: 70 files, 767.5KB
==> Running `brew cleanup expect`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

brew cleanupでキャッシュを削除する

brew cleanup expectが出力されているため実行します。結果、警告表示は解消しました。

% brew cleanup expect
% brew doctor
Your system is ready to brew.

まとめ

brew doctoropenssl@1.1が警告表示される(deprecated)現象と解決方法について紹介しました。
homebrewで管理していないコマンドも影響を受ける可能性がありますが、openssl@1.1は非推奨なのでエラー内容を確認し対応することをおすすめします。(多くのコマンドはopenssl@3に対応してると思いますが。)