I'm trying to install php 5.5 + memcache PHP extension
Ubuntu trusty (14.04)
$ apt-get install php5
Reading package lists... Done
[...]
Setting up php5 (5.5.9+dfsg-1ubuntu4.20) ...
$ apt-get install php5-memcache
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libmcrypt4
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
php-cli php-common php-pear php-xml php7.0-cli php7.0-common php7.0-json
php7.0-opcache php7.0-readline php7.0-xml
Suggested packages:
memcached
The following NEW packages will be installed:
php-cli php-common php-pear php-xml php5-memcache php7.0-cli php7.0-common
php7.0-json php7.0-opcache php7.0-readline php7.0-xml
0 upgraded, 11 newly installed, 0 to remove and 17 not upgraded.
Need to get 2,725 kB of archives.
After this operation, 12.8 MB of additional disk space will be used.
Do you want to continue? [Y/n]
As you can see there is a problem with extra PHP 7.0 extensions:
php7.0-cli
php7.0-common
php7.0-json
php7.0-opcache
php7.0-readline
php7.0-xml
After installation I have PHP 7.0 instead 5.5.
How to avoid upgrading PHP?
So, I don't why this happened but seem there are just two PHP versions 7.0 and 5.5.9.
Quick solution to rewrite command
php
is to update symlinks:I would suggest to only upgrade what you need to upgrade.
apt-get install --only-upgrade <packagename>