パッケージのアンインストール(uninstall)

広告

インストール済みのパッケージをアンインストールする方法を確認します。パッケージのアンインストールには「uninstall」コマンドを使います。

D:¥php>pear help uninstall
pear uninstall [options] [channel/]>package> ...
Uninstalls one or more PEAR packages.  More than one package may be
specified at once.  Prefix with channel name to uninstall from a
channel not in your default channel (pear.php.net)

Options:
  -n, --nodeps
        ignore dependencies, uninstall anyway
  -r, --register-only
        do not remove files, only register the packages as not installed
  -R DIR, --installroot=DIR
        root directory used when installing files (ala PHP's INSTALL_ROOT)
  --ignore-errors
        force install even if there were errors
  -O, --offline
        do not attempt to uninstall remotely


D:¥php>

書式は次の通りです。

pear uninstall [options] [channel/]>package> ...

それでは「Auth」パッケージをアンインストールしてみます。

pear uninstall Auth

パッケージのアンインストール

このようにエラーとなる場合があります。これは「Auth」パッケージがインストールされている「Auth_HTTP」パッケージで必要とされているパッケージだからです。このような場合は先に「Auth_HTTP」パッケージをアンインストールしてから「Auth」パッケージをアンインストールするか、「-n」オプションを付けて実行します。

pear uninstall -n Auth

パッケージのアンインストール

「list」コマンドで確認してみます。

パッケージのアンインストール

「Auth」パッケージがアンインストールされていることが確認できます。

では「Auth_HTTP」パッケージもアンインストールしておきます。

パッケージのアンインストール

( Written by Tatsuo Ikura )