Drush PEAR channel: Error getting channel info from pear.drush.org

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, December 30, 2015

Follow me on Twitter as @mattiasgeniar

If you’re running a Linux server and attempt to use pecl or pear when having an older version of Drush installed, you may run into the following error.

$ pecl upgrade
Error getting channel info from pear.drush.org: File http://pear.drush.org:80/rest/p/packages.xml not valid (received: HTTP/1.1 404 Not Found)
pear.php.net is using a unsupported protocol - This should never happen.
upgrade failed

This is annoying and is a direct result of the way Drush is now being distributed. Until recently, you could install Drush via PEAR packages. That method has been deprecated and replaced with new installation instructions.

But, if you still have Drush installed via Pear, you get the error above.

First, try to remove the old Drush channel from pear/pecl.

$ pecl channel-delete pear.drush.org
Channel "pear.drush.org" has installed packages, cannot delete

Ah, bummer. Makes sense, because Drush was (and still is) installed via pear. To list all packages installed via that channel, use the following command:

$ pear list -c pear.drush.org
Installed packages, channel pear.drush.org:
===========================================
Package Version State
drush   6.2.0.0 stable

In order to remove that Drush channel, remove the package first and replace it with the new Drush installation commands.

$ pear uninstall drush/drush
uninstall ok: channel://pear.drush.org/drush-6.2.0.0

If you’re running RHEL or CentOS, chances are this was installed via yum (which is in the EPEL repositories). Remove those packages in that case.

$ rpm -qa | grep drush
php-channel-drush-1.3-2.el7.noarch
php-drush-drush-6.2.0-3.el7.noarch

$ yum remove php-drush-drush php-channel-drush

Now your pecl/pear configuration is “clean” again with no more broken channels.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.