21.7. Uninstalling PEAR Packages

Problem

You wish to remove a PEAR package from your system.

Solution

The uninstall command tells the PEAR package manager to delete packages:

% pear uninstall HTML_Common
uninstall HTML_Common ok

Discussion

Uninstalling a package removes it completely from your system. If you want to reinstall it, you must begin as if the package was never installed. PEAR doesn’t warn you if you try to remove a package that’s dependent on another package, so be careful when you uninstall.

There is no way to automatically roll back an upgrade to an earlier version of a package using uninstall. Also, PEAR complains if you try to install an earlier version over a later one. To force PEAR to overwrite a newer version, use install -f or install --force:

% pear install --force Net_URL
downloading Net_URL-1.0.4.tgz ...
...done: 3,540 bytes
install ok: Net_URL 1.0.4

The short command for uninstall is un.

See Also

Recipe 21.5 and Recipe 21.6 for information on installing PEAR and PECL packages.

Get PHP Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.