MacPorts¶
インストール¶
MacPorts公式サイトのQuickstartページから、macOSバージョンに対応した pkg ファイル(macOS インストーラー)をダウンロードします。
https://www.macports.org/install.php
macOS 15 Sequoia の場合、ダウンロードファイル名は MacPorts-2.11.4-15-Sequoia.pkg でした。実行するとインストールが行われます。
コマンドは、/opt/local/binの下にインストールされるので、シェルの設定で環境変数PATHなどを設定する必要があります。
PATH="/opt/local/bin:$PATH"
macOSのアップデート時¶
macOS Tahoe¶
macOSのバージョンをアップすると、portコマンドがエラーとなります。
~ % port
Error: Current platform "darwin 25" does not match expected platform "darwin 24"
Error: Please run 'sudo port migrate' or follow the migration instructions: https://trac.macports.org/wiki/Migration
OS platform mismatch
while executing
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, OS platform mismatch
メッセージにあるように、sudo port migrate を実行します。
アンインストール¶
方法調査メモ¶
- インストール済のport群を削除
sudo port -fp uninstall installed - macportsユーザーとmacportsグループを削除?
sudo dscl . -delete /Users/macports sudo dscl . -delete /Groups/macports
- MacPortsが使用するディレクトリを削除
- /opt/local
- /Application/MacPorts
- /Library/LaunchDaemons/org.macports.*
- ~/.macports
portコマンド¶
インストール一覧¶
port installed
パッケージのインストール記録¶
GIS¶
QGIS¶
QGISのLTR(Long Term Release)を MacPorts経由でインストールしました。2025年8月時点でLTRは、バージョン3.40となります。
% sudo port install qgis3-ltr
結構な数のパッケージがダウンロードされ、インストールされ、ものによってはビルドされるので、結構時間がかかります。
インストールが終わると、Launchpad(ランチャー)にQGISが追加されるので、これを実行するとQGISが立ち上がります。
macOS 26 (Tahoe)ではインストール不可¶
% sudo port install qgis3-ltr Password: ---> Computing dependencies for qgis3-ltr clang-15 is known to fail. Try to install anyway? [y/N]: n Error: clang-15 is known to fail Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port qgis3-ltr failed