Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pear - succeeded, but it is not a valid package

Tags:

php

ubuntu

pecl

During a pecl package installation, i got the error,

Download of "pecl/pecl_http" succeeded, but it is not a valid package archive
Error: cannot download "pecl/pecl_http"

This error is coming for all the packages. So i tried the solution given here, http://cweiske.de/tagebuch/pear-php-5.5.htm. But it is not working. And i don't have any other clue on this. It would be really helpful if someone explains what exactly the problem is. Please help.

like image 842
Stranger Avatar asked May 20 '14 14:05

Stranger


Video Answer


2 Answers

This bug commonly affects systems upgraded to Ubuntu 14.04 LTS from Ubuntu 12.04 LTS.

There is a workaround for php5-5.5.9 as commented by kolAflash on Launchpad.

The workaround contains a small typo (tar instead of tgz), so I provide a working solution:

# First run pear to download the packages. It will probably put the packages into
# /build/buildd/php5-5.5.9+dfsg/pear-build-download/
# but it can't install them.
$ pear upgrade

# Un-Gzip the downloaded packages.
$ gunzip /build/buildd/php5-5.5.9+dfsg/pear-build-download/*.tgz

# Now pear should be able to work with the pure tar-files.
$ pear upgrade /build/buildd/php5-5.5.9+dfsg/pear-build-download/*.tar

All credit for this workaround obviously goes to kolAflash.

like image 107
Werner Avatar answered Oct 23 '22 09:10

Werner


Seems that Pear can't install from tgz archive. You have to explicitly request uncompressed files when downloading with -Z, --nocompress option.

So, try sudo pear install -Z package

like image 20
Nicolae Erast Avatar answered Oct 23 '22 09:10

Nicolae Erast