macportsでインストールしたphpを整理する

$ sudo port select php
Password:
Available versions for php:
    none
    php53
    php56 (active)
$ sudo port uninstall php53-curl
--->  Deactivating php53-curl @5.3.29_0
--->  Cleaning php53-curl
--->  Uninstalling php53-curl @5.3.29_0
--->  Cleaning php53-curl
$ sudo port uninstall php53
--->  Unable to uninstall php53 @5.3.29_0+libedit, the following ports depend on it:
--->     php53-imagick @3.1.2_1
--->     php53-gd @5.3.29_0
--->     php53-mbstring @5.3.29_0
--->     php53-mcrypt @5.3.29_0
--->     php53-mysql @5.3.29_0+mysqlnd
--->     php53-openssl @5.3.29_0
--->     php53-zip @5.3.29_0
Error: org.macports.uninstall for port php53 returned: Please uninstall the ports that depend on php53 first.
Please see the log file for port php53 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_registry_portfiles_php53-5.3.29_0_d8624947e372cf180742ba2a4afcaf8906eca883dc8870596f09a45dd13008fb-44378/php53/main.log
Warning: Failed to execute portfile from registry for php53 @5.3.29_0+libedit
--->  Unable to uninstall php53 @5.3.29_0+libedit, the following ports depend on it:
--->     php53-imagick @3.1.2_1
--->     php53-gd @5.3.29_0
--->     php53-mbstring @5.3.29_0
--->     php53-mcrypt @5.3.29_0
--->     php53-mysql @5.3.29_0+mysqlnd
--->     php53-openssl @5.3.29_0
--->     php53-zip @5.3.29_0
Error: port uninstall failed: Please uninstall the ports that depend on php53 first.

依存しているものがあり削除できない旨のエラーが出たので、一つ一つ削除していく。

$ sudo port uninstall php53-imagick php53-gd php53-mbstring php53-mcrypt php53-mysql php53-openssl php53-zip
--->  Deactivating php53-imagick @3.1.2_1
--->  Cleaning php53-imagick
--->  Uninstalling php53-imagick @3.1.2_1
--->  Cleaning php53-imagick
--->  Deactivating php53-gd @5.3.29_0
--->  Cleaning php53-gd
--->  Uninstalling php53-gd @5.3.29_0
--->  Cleaning php53-gd
--->  Deactivating php53-mbstring @5.3.29_0
--->  Cleaning php53-mbstring
--->  Uninstalling php53-mbstring @5.3.29_0
--->  Cleaning php53-mbstring
--->  Deactivating php53-mcrypt @5.3.29_0
--->  Cleaning php53-mcrypt
--->  Uninstalling php53-mcrypt @5.3.29_0
--->  Cleaning php53-mcrypt
--->  Deactivating php53-mysql @5.3.29_0+mysqlnd
--->  Cleaning php53-mysql
--->  Uninstalling php53-mysql @5.3.29_0+mysqlnd
--->  Cleaning php53-mysql
--->  Deactivating php53-openssl @5.3.29_0
--->  Cleaning php53-openssl
--->  Uninstalling php53-openssl @5.3.29_0
--->  Cleaning php53-openssl
--->  Deactivating php53-zip @5.3.29_0
--->  Cleaning php53-zip
--->  Uninstalling php53-zip @5.3.29_0
--->  Cleaning php53-zip
hrt0kmt@omac:~$ sudo port uninstall php53
--->  Deactivating php53 @5.3.29_0+libedit
--->  Cleaning php53
--->  Uninstalling php53 @5.3.29_0+libedit
--->  Cleaning php53

$ sudo port uninstall php54-pear

$ sudo port uninstall php54

$ sudo port uninstall php5

完了しました。