What is the command to uninstall a pear package?
4 Answers
pear uninstall [options] [channel/]<package>
So if you wanted to uninstall PHPUnit
pear uninstall phpunit/PHPUnit
Note: remember to preface with sudo
or you won't have permission to uninstall anything.

- 227,796
- 193
- 515
- 708
-
Assuming you installed pear into a root only location. It's possible to setup pear to use your local user account (something like ~/PEAR) in which case the sudo isn't needed. – Alana Storm Oct 14 '09 at 22:15
pear uninstall package_name
You can read about it here in the PHP Cookbook

- 68,817
- 22
- 142
- 198
If you're on a RPM Linux Distro, it's simple with YUM
If you installed a PEAR package with YUM you can uninstall with YUM as well.
yum install php-pear-db
to install and
yum remove php-pear-db
to remove.

- 8,728
- 11
- 46
- 62

- 83,471
- 91
- 263
- 383
-
The question is: how to uninstall *a* PEAR package, PEAR is a repository of packages. You're answering the question how to uninstall *the* PEAR package, which is a piece of Linux software. – Niels Bom Nov 18 '11 at 10:12
-
@NielsBom Yes I understand the difference but some of PEAR's packages can be install with YUM/Apt-Get/etc.. (Other packet managers). So yum remove php-pear* should remove any Pear packages that were install with YUM. – Phill Pafford Nov 18 '11 at 14:24
-
And how would you then uninstall a _specific_ PEAR package using this command? – Niels Bom Nov 21 '11 at 14:19
-
Again let me stress, if you installed a PEAR package with YUM you can uninstall with YUM as well. yum install php-pear-db to install yum remove php-pear-db to remove. The OP never states how they installed the Pear Package this is why I said IF you're on a RPM Linux Distro – Phill Pafford Nov 21 '11 at 14:22
-
-: Additional :-
The uninstall command removes a package and accepts a list of installed packages to remove as arguments.
Plugins must be explicitly uninstalled with the -p or --plugin option. Plugins are installed into the location specified by the plugins_dir configuration variable, which defaults to the same location that the user configuration file is located ($HOME/.pear in unix, \pear on windows).
php pyrus.phar uninstall -p PEAR2_Pyrus_Developer

- 10,121
- 1
- 29
- 55