Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to download pear/HTTP_Request2 within preferred state "stable"

When trying to do

pear install phpunit/PHPUnit

I get the following error

    Failed to download pear/HTTP_Request2 within preferred state "stable", latest release is version 2.0.0RC1, stability "beta", use "channel://pear.php.net/HTTP_Request2-2.0.0RC1" to install
phpunit/PHPUnit can optionally use PHP extension "curl"
phpunit/PHPUnit can optionally use PHP extension "dbus"
pear/XML_RPC2 requires package "pear/HTTP_Request2" (version >= 0.6.0)
phpunit/PHPUnit requires package "pear/XML_RPC2"
No valid packages found
install failed

It says right there to use another channel, but I can't seem to discover or add that channel! What's the correct command to do this, or what else could I do?

Thank you very much, MrB

edit:

Got it, wow, 10s after posting.

pear install HTTP_Request2-2.0.0RC1
like image 825
MrB Avatar asked Jul 21 '11 18:07

MrB


1 Answers

As mentioned in the online PEAR manual, the PEAR installer by default only installs stable packages. If you wish to install a package that hasn't yet been declared stable, you can do so, without changing the preferred state, by also specifying the version number or its state when attempting to install it. Thus:

$ pear install -f package_name-1.2.3

Or, if a package is in beta you can install it with:

$ pear install -f package_name-beta

Similarly, if the package is in alpha:

$ pear install -f package_name-alpha

There is a 'devel' stability state too, but not that many packages are released in that state. Sometimes the error message will include a useful hint, as seen in your question above ;)

like image 168
kguest Avatar answered Oct 11 '22 14:10

kguest