0

Can someone give me step my step instructions on how to do this?

Will I have to worry about and data/databse loss doing this.

Thanks!

sudo apt-get remove --purge dpkg -l | grep php | grep -w 5.5 | awk '{print $2}' | xargs

sudo apt-get install php5=5.4.23-1ubuntu3.4 php5-cli=5.4.23-1ubuntu3.4 php5-common=5.4.23-1ubuntu3.4 libapache2-mod-php5=5.4.23-1ubuntu3.4

sudo apt-get install php5=5.4.23-1ubuntu3.4 php5-cli=5.4.23-1ubuntu3.4 php5-common=5.4.23-1ubuntu3.4 libapache2-mod-php5=5.4.23-1ubuntu3.4

sudo apt-get install php-pear=5.4.23-1ubuntu3.4 php5-curl=5.4.23-1ubuntu3.4 php5-gd=5.4.23-1ubuntu3.4 php5-intl=5.4.23-1ubuntu3.4 php5-mysql=5.4.23-1ubuntu3.4 php5-pspell=5.4.23-1ubuntu3.4 php5-recode=5.4.23-1ubuntu3.4 php5-snmp=5.4.23-1ubuntu3.4 php5-sqlite=5.4.23-1ubuntu3.4 php5-tidy=5.4.23-1ubuntu3.4 php5-xmlrpc=5.4.23-1ubuntu3.4 php5-xsl=5.4.23-1ubuntu3.4

1

My versions were a little different, but I have searched high and low for a method that wouldn't uninstall half my system (with laborious custom configurations) just because PHP auto-upgraded from 5.4.28 to 5.4.29, which broke Symfony projects for all our developers and QA.

Essentially, this happened overnight:

+ apt-get -y --force-yes -o Dpkg::Options::=--force-confdef upgrade
Reading package lists...
Building dependency tree...
Reading state information...
The following packages have been kept back:
  libspice-server1
The following packages will be upgraded:
  libapache2-mod-php5 php-pear php5 php5-cli php5-common php5-curl php5-gd
  php5-intl php5-ldap php5-mcrypt php5-mysql php5-readline
12 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 6,221 kB of archives.
After this operation, 9,216 B of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu/ precise/main libapache2-mod-php5 amd64 5.4.29-2+deb.sury.org~precise+1 [2,678
kB]

etc.

Notice that NO other packages got upgraded/changed. (So why when backstepping, would they need to be removed later?? Wrong.)

After giving up on all the conventional "proper" methods to keep stable dependencies,

Finally, I ran

aptitude versions php5 

to see what was available.

Many packages appeared, but the one that seemed most core was php5-common:

Package php5-common:i386:
p   5.3.10-1ubuntu3                                                            precise                                                 500
p   5.3.10-1ubuntu3.11                                                         precise-security,precise-updates                        500
p   5.4.28-1~ppa1~precise                                                      precise                                                 500
p   5.4.29-2+deb.sury.org~precise+1                                            precise                                                 500

5.4.29-2+deb.sury.org~precise+1 was the new update this morning causing trouble:

5.4.28-1~ppa1~precise is apparently what we need to downgrade to. However, apt-get and synaptic insist on REMOVING many innocent and seemingly unrelated packages we NEED to keep in place untouched, that were NOT upgraded today, and do depend on SOME version of PHP, but not specifically 5.4.29-2+deb.sury.org~precise+1 suddenly.

No thanks!

aptitude install php5-common=5.4.28-1~ppa1~precise

run interactively at first gave me the same options. As I kept refusing, it kept offering more suggestions. Finally, around the 5th suggestion was this:

Accept this solution? [Y/n/q/?] n The following actions will resolve these dependencies:

 Keep the following packages at their current version:

1) php5-common [5.4.29-2+deb.sury.org~precise+1 (now, precise)]

Accept this solution? [Y/n/q/?] n The following actions will resolve these dependencies:

  Remove the following packages:

1) php5-readline

  Downgrade the following packages:

2) libapache2-mod-php5 [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)] 3) php-pear [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.12-1~ppa1~precise (precise)] 4) php5-cli [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)] 5) php5-curl [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)] 6) php5-gd [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)] 7) php5-intl [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)] 8) php5-ldap [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)] 9) php5-mcrypt [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)] 10) php5-mysql [5.4.29-2+deb.sury.org~precise+1 (now, precise) -> 5.4.28-1~ppa1~precise (precise)]

  Leave the following dependencies unresolved:

11) php5-cli recommends php5-readline

That seemed good enough! I could see about php5-readline manually later.

Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
  libapache2-mod-php5 php-pear php5-cli php5-common php5-curl php5-gd php5-intl php5-ldap php5-mcrypt php5-mysql
The following packages will be REMOVED:
  libonig2{u} libqdbm14{u} php5-readline{a}
0 packages upgraded, 0 newly installed, 10 downgraded, 3 to remove and 2 not upgraded.
Need to get 8,277 kB of archives. After unpacking 1,818 kB will be used.
Do you want to continue? [Y/n/?] Y
[100%] Writing extended state information

Now check the php version: (php5-cli gets invoked)

php -i |less

phpinfo() PHP Version => 5.4.28-1~ppa1~precise

 apt-cache policy php5-cli
php5-cli:
  Installed: 5.4.28-1~ppa1~precise
  Candidate: 5.4.29-2+deb.sury.org~precise+1
  Version table:
     5.4.29-2+deb.sury.org~precise+1 0
        500 http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu/ precise/main amd64 Packages
 *** 5.4.28-1~ppa1~precise 0
        500 http://ppa.launchpad.net/nathan-renniewaldock/ppa/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status
     5.3.10-1ubuntu3.11 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     5.3.10-1ubuntu3 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

Great!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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