Quick checks for PHP PEAR and PECL updates
January 24, 2010,
Ideally all software on a system is installed via one package manager. Reality is a bit different. As an administrator you need to stay on top on updates from all software that is installed instead of relying on the system's package manager.
Some software packages do their own updates. These updates are done outside of the system's package manager. A good example is Firefox which has a 'search for updates' function (so distributors usually disable the auto-update mechanism).
A bit closer to a sysadmin's home are the extension mechanisms that various interpreters have, such as Perl (CPAN), Python (PyPI) and PHP (PEAR and PECL). Software is installed and updated through various helper programs. Since the software is installed through these programs and not through the package manager (yum + RPM) updates don't show up in the list of updates when you ask your package manager. This makes it easy to miss these updates.
For PEAR it is very simple to get a daily list of updates mailed to you from cron:
05 15 * * * root nice -n 19 /usr/bin/pear list-upgrades
Similarly for PECL:
05 15 * * * root nice -n 19 /usr/bin/pecl list-upgrades
It's very simple, but also very effective.
Neither program has a 'quiet' option but with a little magic from grep it is easy to prevent mails from being sent by cron:
05 15 * * * root nice -n 19 /usr/bin/pear list-upgrades | grep -v 'No upgrades available'