pear manual needs more information on installing packages
| From: | Jim Crapuchettes | Date: | Thu, 02 Aug 2007 19:14:20 +0000 |
| Subject: | pear manual needs more information on installing packages | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-27790@lists.php.net to get a copy of this message | ||
All,
If I am sending this to the wrong list, I apologize for bothering all of you and ask that you would forward it to the correct list. Thank you.
My first request: Please add a chapter to the pear manual describing how to use pear to install or upgrade pear packages, with at least several examples. Assume that the user knows *nothing* about pear except how to execute from the command line.
My second request: Please add more information on "channels". I was not able to find any adequate explanation of what they are and how they should be used or even whether I should care. I did find a page describing what a great thing they are but without a definition and explanation, the page was no help.
My third request (pear itself): It would be helpful if specifying a package name without any version information would *always* get the latest version, whether it is "stable" or version 1 or above. If this is considered unsafe, adding "-*" to the end of the package name to achieve this result would also be helpful.
Here is a brief explanation for my first request (some from memory, so the details may not be correct):
I wanted to use the latest version of Spreadsheet_Excel_Writer package but could not determine how to update the previous version that was installed on the Linux system that I use.
Initially I tried using the pear installer. Looking at the Web site for instructions, I saw the memo saying that the pear installer should be upgraded because of a security problem. So, I tried to do that first. The first set of messages I saw said that something was wrong with the "channel". After many tries, I finally figured out that I needed to do a "channel-update", and that seemed to work. Then I tried to update pear itself. I don't remember how many attempts I made before I finally tried "pear upgrade PEAR"; this certainly was NOT obvious and it would have been a great help if the memo saying that pear should be updated had spelled this out explicitly (i.e. step-by-step).
Then it was time to try again to update Spreadsheet_Excel_Writer. Again, I do not know how many different things I tried but know that I looked at the Web site for both pear and Spreadsheet_Excel_Writer and could find nothing that helped me. All attempts to use the pear installer directly failed.
So, I downloaded the .tgz file but did not see any instructions about how to install it. After searching through many pages of the pear manual and trying the help command in pear, I finally found a statement somewhere (I don't remember where and it would probably take me an hour to find it again) saying that directly installing a package without using pear was not a good idea, so I gave up on this method. It was only while working on this e-mail that I noticed that "pear help install" says it will install from a .tgz file.
Back to the pear installer. More reading of Web pages and use of the help command to pear and attempts to install or update Spreadsheet_Excel_Writer. I think I used "pear list-all" to try to see if the package really existed, but could not. I am perfectly willing to admit that I overlooked or misunderstood many things during my attempts, but that only emphasizes my suggestion that you need a clear chapter in the manual to get the first-time user started.
What follows is the (slightly edited to remove my typos, etc) set of commands that I executed to finally get the spreadsheet writer updated on the Linux system. As you can see, I stumbled around quite a bit due to my lack of understanding of what I needed to do.
Just so you know, I have been working with computers for over 40 years doing a wide range of software and some hardware, so I am not really a newbie, I just could not find one place that gave me a handle on what I needed to do.
Jim Crapuchettes
Senior Software Engineer
[root@dev www]# pear download PEAR::Spreadsheet_Excel_Writer
Cannot initialize 'PEAR::Spreadsheet_Excel_Writer', invalid or missing package file
Package "PEAR::Spreadsheet_Excel_Writer" is not valid
download failed
[root@dev www]# pear help install
pear install [options] [channel/]<package> ...
Installs one or more PEAR packages. You can specify a package to
install in four ways:
"Package-1.0.tgz" : installs from a local file
"http://example.com/Package-1.0.tgz" : installs from
anywhere on the net.
"package.xml" : installs the package described in
package.xml. Useful for testing, or for wrapping a PEAR package in
another package manager such as RPM.
"Package[-version/state][.tar]" : queries your default channel's server
(pear.php.net) and downloads the newest package with
the preferred quality/state (stable).
To retrieve Package version 1.1, use "Package-1.1," to retrieve
Package state beta, use "Package-beta." To retrieve an uncompressed
file, append .tar (make sure there is no file by the same name first)
To download a package from another channel, prefix with the channel name like
"channel/Package"
More than one package may be specified at once. It is ok to mix these
four ways of specifying packages.
Options:
-f, --force
will overwrite newer installed packages-l, --loose
do not check for recommended dependency version-n, --nodeps
ignore dependencies, install anyway-r, --register-only
do not install files, only register the package as installed-s, --soft
soft install, fail silently, or upgrade if already installed-B, --nobuild
don't build C extensions-Z, --nocompress
request uncompressed files when downloading-R DIR, --installroot=DIR
root directory used when installing files (ala PHP's INSTALL_ROOT), use packagingroot for RPM-P DIR, --packagingroot=DIR
root directory used when packaging files, like RPM packaging--ignore-errors
force install even if there were errors-a, --alldeps
install all required and optional dependencies-o, --onlyreqdeps
install all required dependencies-O, --offline
do not attempt to download any urls or contact channels-p, --pretend
Only list the packages that would be downloaded[root@dev www]# pear install Spreadsheet_Excel_Writer Failed to download pear/Spreadsheet_Excel_Writer within preferred state "stable", latest release is version 0.9.1, stability "beta", use "channel://pear.php.net/Spreadsheet_Excel_Writer-0.9.1" to install Cannot initialize 'channel://pear.php.net/Spreadsheet_Excel_Writer', invalid or missing package file Package "channel://pear.php.net/Spreadsheet_Excel_Writer" is not valid install failed [root@dev www]# pear install pecl/Spreadsheet_Excel_Writer No releases available for package "pecl.php.net/Spreadsheet_Excel_Writer" Cannot initialize 'channel://pecl.php.net/Spreadsheet_Excel_Writer', invalid or missing package file Package "channel://pecl.php.net/Spreadsheet_Excel_Writer" is not valid install failed [root@dev www]# pear install Spreadsheet_Excel_Writer-0.9.1 pear/Spreadsheet_Excel_Writer requires package "pear/OLE" (version >= 0.5), installed version is 0.4 No valid packages found install failed [root@dev www]# pear upgrade pear/OLE Failed to download pear/OLE within preferred state "stable", latest release is version 0.5, stability "beta", use "channel://pear.php.net/OLE-0.5" to install Cannot initialize 'channel://pear.php.net/OLE', invalid or missing package file Package "channel://pear.php.net/OLE" is not valid upgrade failed [root@dev www]# pear install channel://pear.php.net/OLE-0.5 Ignoring installed package pear/OLE Nothing to install [root@dev www]# pear install OLE-0.5 Ignoring installed package pear/OLE Nothing to install [root@dev www]# pear upgrade OLE Failed to download pear/OLE within preferred state "stable", latest release is version 0.5, stability "beta", use "channel://pear.php.net/OLE-0.5" to install Cannot initialize 'channel://pear.php.net/OLE', invalid or missing package file Package "channel://pear.php.net/OLE" is not valid upgrade failed [root@dev www]# pear upgrade OLE-0.5 downloading OLE-0.5.tgz ... Starting to download OLE-0.5.tgz (9,058 bytes) ......done: 9,058 bytes upgrade ok: channel://pear.php.net/OLE-0.5 [root@dev www]# pear install Spreadsheet_Excel_Writer-0.9.1 downloading Spreadsheet_Excel_Writer-0.9.1.tgz ... Starting to download Spreadsheet_Excel_Writer-0.9.1.tgz (55,037 bytes) ..............done: 55,037 bytes install ok: channel://pear.php.net/Spreadsheet_Excel_Writer-0.9.1 [root@dev www]#