sudo port install peco rmtrash source-highlight the_silver_searcher tmux
sudo port selfupdate
xcodebuild -license
$ port installed > list.xt $ sudo port deactivate active $ sudo port -f uninstall installed $ sudo port clean all $ sudo rm -rf /Library/Tcl/macports1.0 $ sudo mv /opt/local /opt/local.old
port -qv installed > myports.txt
port echo requested | cut -d ' ' -f 1 > requested.txt
sudo port -f uninstall installed
sudo rm -rf /opt/local/var/macports/build/*
curl --location --remote-name \ https://github.com/macports/macports-contrib/raw/master/restore_ports/restore_ports.tcl chmod +x restore_ports.tcl sudo ./restore_ports.tcl myports.txt
sudo port unsetrequested installed xargs sudo port setrequested < requested.txt
※最後の2つの手順はやめて自力でインストールしなおしてもよいかも。
sudo port -fp uninstall installed sudo /bin/rm -rf \ /opt/local \ /Applications/DarwinPorts \ /Applications/MacPorts \ /Library/LaunchDaemons/org.macports.* \ /Library/Receipts/DarwinPorts*.pkg \ /Library/Receipts/MacPorts*.pkg \ /Library/StartupItems/DarwinPortsStartup \ /Library/Tcl/darwinports1.0 \ /Library/Tcl/macports1.0 \ ~/.macports
zsh: no matches found: /Library/LaunchDaemons/org.macports.* zsh: no matches found: /Library/Receipts/DarwinPorts*.pkg zsh: no matches found: /Library/Receipts/MacPorts*.pkg
sudo /bin/rm -rf \ /opt/local \ /Applications/DarwinPorts \ /Applications/MacPorts \ /Library/StartupItems/DarwinPortsStartup \ /Library/Tcl/darwinports1.0 \ /Library/Tcl/macports1.0 \ ~/.macports
sudo port selfupdate
portコマンド自体の更新とローカルにキャッシュしていあるパッケージ情報が更新される。定期的に実行しないと古いパッケージがインストールされるかもしれないという問題がある?(Mint's log: MacPortsのselfupdateを忘れた→はまる)。
sudo port outdated
sudo port upgrade installed
sudo port upgrade -u installed
sudo port uninstall inactive
sudo port upgrade emacs
sudo port upgrade -u emacs
sudo port search <パッケージ名>
sudo provides <ファイル名>
sudo port list
sudo port list installed
sudo port install <パッケージ名>
sudo port install zmq @3.2.2
sudo port installed imagemagick
sudo port activate ImageMagick @6.9.4-4_0+x11
sudo port uninstall <パッケージ名>
sudo port uninstall inactive
sudo port unintall --follow-dependents <パッケージ名>
sudo port uninstall --follow-dependents libcomerr
sudo port unintall --follow-dependencies <パッケージ名>
以下参考情報
sudo port uninstall --follow-dependents python34
sudo port uninstall php71*
実例
sudo port install php56-apache2handler php56-mysql php56-mbstring sudo port installed | grep php php56 @5.6.40_2+libedit (active) php56-apache2handler @5.6.40_0 (active) php56-mbstring @5.6.40_0 (active) php56-mysql @5.6.40_0+mysqlnd (active) php_select @1.0_0 (active)
$ sudo port uninstall php56 sudo port installed | grep php php56-apache2handler @5.6.40_0 (active) php56-mbstring @5.6.40_0 (active) php56-mysql @5.6.40_0+mysqlnd (active) php_select @1.0_0 (active)
sudo port uninstall --follow-dependencies php56 sudo port installed | grep php php56-apache2handler @5.6.40_0 (active) php56-mbstring @5.6.40_0 (active) php56-mysql @5.6.40_0+mysqlnd (active)
sudo port uninstall --follow-dependents php56 sudo port installed | grep php php_select @1.0_0 (active)
sudo port contents apr
sudo port provides ./libaprutil-1.0.dylib
sudo port installed > list.txt
sudo port installed requested > requested_list.txt
port installed php5
sudo port upgrade --enforce-variants php5 +pear
MacPortsの良い点
MacPortsの悪い点
Homebrewの良い点
Homebrewの悪い点
結論。完全性を求める向きはMacPortsでいいのではないか。コンパイルに時間かかるけどHomebrewだってそれなりに時間かかる(Linuxのようにバイナリを入れるわけではないので)。
逆にもっとラフな感じで使いたい場合はHomebrewか。Rubyでいじれるのは魅力的。
sudo patch -p0 < port.patch
Error: org.macports.install for port apr returned: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_apr/apr/work/destroot