Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to downgrade php on a server and found the command below. Something seems to be wrong with the syntax.

yum downgrade $(rpm -qa --qf "%{NAME} " | \
            grep -v ioncube | grep ^php | awk '{print $1"-5.2.17"}')

I get the following error message:

Error: Need to pass a list of pkgs to downgrade
usage: yum [options] COMMAND
share|improve this question
    
This generate error because rpm output is just single long line (you replace standard \n in output with just " "), so next grep ^php produce empty output - if you use just rpm -qa then this method will work too. –  dsznajder May 10 '13 at 20:42
add comment

2 Answers 2

I think you are making the command line far too complicated:

sudo yum downgrade php-*

I don't think that is going to get you what you want though.

share|improve this answer
    
Thanks for your response. This actually led me to what I ended up doing. –  ddjammin May 10 '13 at 18:06
add comment
up vote 0 down vote accepted

My situation might a little specific but here is what worked for me. I am sure there is a better way but....

I added the atomic repo. wget -qq -O - http://www.atomicorp.com/installers/atomic | /bin/bash

Sent all the installed programs to a file. rpm -qa --qf "%{NAME} "> installed

Filtered the results to a new file with just the apps that I needed. The grep -v command did not work as I thought it would. I needed to exclude the phpioncube and I thought the -v would do it but it still showed up the file. I manually deleted it. grep -v ioncube installed |grep php installed>phpapps

I knew the specific version that I wanted to downgrade to so I appended it to each package name and ran the following command. yum downgrade install php-pdo-5.2.17-1.el6.art.x86_64 php-pecl-memcached-5.2.17-1.el6.art.x86_64 php-xml-5.2.17-1.el6.art.x86_64 php-pecl-memcache-5.2.17-1.el6.art.x86_64 php-5.2.17-1.el6.art.x86_64 php-pear-5.2.17-1.el6.art.x86_64 php-mcrypt-5.2.17-1.el6.art.x86_64 php-xmlrpc-5.2.17-1.el6.art.x86_64 php-snmp-5.2.17-1.el6.art.x86_64 php-odbc-5.2.17-1.el6.art.x86_64 php-ldap-5.2.17-1.el6.art.x86_64 php-common-5.2.17-1.el6.art.x86_64 php-mysql-5.2.17-1.el6.art.x86_64 php-gd-5.2.17-1.el6.art.x86_64 php-mbstring-5.2.17-1.el6.art.x86_64 php-cli-5.2.17-1.el6.art.x86_64 php-devel-5.2.17-1.el6.art.x86_64 php-pecl-zip-5.2.17-1.el6.art.x86_64 php-imap-5.2.17-1.el6.art.x86_64 php-ncurses-5.2.17-1.el6.art.x86_64 php-mhash-5.2.17-1.el6.art.x86_64

This got me what I needed.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.