Pear - succeeded, but it is not a valid package
Asked Answered
P

5

15

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.

Passionate answered 20/5, 2014 at 14:9 Comment(0)
F
23

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.

Filamentary answered 23/5, 2014 at 8:13 Comment(2)
and kolAflash are heros! TYVM.Thanasi
This solution also works for mailparse-2.1.6 for php5.Ommatidium
R
15

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

Rhizome answered 28/8, 2014 at 8:25 Comment(0)
C
9

The best solution for this is to upgrade PEAR's Archive package, which the pear installer uses, and after that you won't need to explicitly request uncompressed files when installing new, or upgrading existing, packages.

$ sudo pear upgrade -Z Archive_Tar

You should not have to do this for any other package so long as you do it for Archive_Tar first.

This problem happens because Ubuntu changed the pack/unpack format strings a bit to align them to the Perl behavior, which breaks backwards compatibility. PEAR fixed this in successive versions of Archive_Tar (Ubuntu kept making those changes in each successive version of PHP...). And so the pear installer requires a later version of Archive_Tar than 1.3.11 - details are at https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1434099.

You will need to do this after each 'Software Upgrade' affecting PHP that Ubuntu proffers, as the upgrade rolls back the version of Archive_Tar you have installed locally. It also rolls back the Console_Getopt, XML_Util and PEAR packages.

Coffeepot answered 18/3, 2015 at 12:8 Comment(2)
Unfortunately, this now gives the same error that this stackoverflow question refers to, since Archive_Tar is compressed with the newer version format.Vocabulary
Exactly. It can't upgrade itself. what a POS.Rockies
G
3

I had this problem and eventually got Archive_Tar to update by

gunzip *.tgz tar -xvf Archive_Tar-1.4.2.tar mv package.xml Archive_Tar-1.4.2 cd Archive_Tar-1.4.2 pear upgrade package.xml

After that worked, pear upgrade worked for me. I previously had Archive_Tar-1.3.10 and was upgrading to 1.4.2

Gosse answered 16/1, 2017 at 23:6 Comment(0)
M
0

Look like this is a bug and is tied with some specific version of software piece. Quick googling found a link to cpanel forums with such problem as old as 2011, and quite fresh https://bugs.php.net/bug.php?id=67075 . Consider changing php version/switching from 32-bit system (for example, it is reproducible with 32-bit fresh new Ubuntu 14.04 and not reproducible with 64-bit version of the same).

Mohican answered 20/5, 2014 at 14:48 Comment(2)
Thanks for your answer. But we have some projects written for 32-bit architecture :(Passionate
Then you have to downgrade to previous Ubuntu version - or just wait until the bug would be fixed. Of course, there is an option to contribute to it, but I think that this isn't an option.Mohican

© 2022 - 2024 — McMap. All rights reserved.