web-dev-qa-db-fra.com

installer le module php7.0 avec une ancienne version spécifique sans mettre à niveau php

Mon environnement de production a php7.0.18-0ubuntu0.16.04.1, j'essaye d'installer un nouveau module (php7.0-bcmath) mais je ne trouve pas le moyen de l'installer sur la même version que celle que j'ai déjà pour php

$ apt-cache policy php7.0
php7.0:
  Installed: 7.0.18-0ubuntu0.16.04.1
  Candidate: 7.0.22-0ubuntu0.16.04.1
  Version table:
     7.0.22-0ubuntu0.16.04.1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/main AMD64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main AMD64 Packages
 *** 7.0.18-0ubuntu0.16.04.1 100
        100 /var/lib/dpkg/status
     7.0.4-7ubuntu2 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/main AMD64 Packages
$

7.0.18 ressemble au paquet de version avec ubuntu install.

Politique pour bcmath:

$ apt-cache policy php7.0-bcmath
php7.0-bcmath:
  Installed: (none)
  Candidate: 7.0.22-0ubuntu0.16.04.1
  Version table:
     7.0.22-0ubuntu0.16.04.1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe AMD64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/universe AMD64 Packages
     7.0.4-7ubuntu2 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/universe AMD64 Packages
$

Si j'essaie d'installer bcmath, je peux également mettre à jour php

$ Sudo apt-get -s install php7.0-bcmath
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  php7.0 php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml php7.0-Zip
Suggested packages:
  php-pear
The following NEW packages will be installed:
  php7.0-bcmath
The following packages will be upgraded:
  php7.0 php7.0-cli php7.0-common php7.0-curl php7.0-fpm php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml php7.0-Zip
12 upgraded, 1 newly installed, 0 to remove and 93 not upgraded.
Inst php7.0-mysql [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-xml [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-json [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-Zip [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-curl [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-mbstring [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-opcache [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-readline [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-fpm [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0-cli [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64]) []
Inst php7.0 [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [all]) []
Inst php7.0-common [7.0.18-0ubuntu0.16.04.1] (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Inst php7.0-bcmath (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-common (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-mysql (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-xml (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-json (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-Zip (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-curl (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-mbstring (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-opcache (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-readline (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-cli (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0-fpm (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
Conf php7.0 (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [all])
Conf php7.0-bcmath (7.0.22-0ubuntu0.16.04.1 Ubuntu:16.04/xenial-updates, Ubuntu:16.04/xenial-security [AMD64])
$

Et si j'essaie de forcer une version:

$ Sudo apt-get -s install php7.0-bcmath=7.0.18-0ubuntu0.16.04.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '7.0.18-0ubuntu0.16.04.1' for 'php7.0-bcmath' was not found
$

Mettre à jour vers php7.0.22 est la (bonne) solution, je le sais, mais y a-t-il un moyen d'installer ce module sans le temps d'indisponibilité que j'aurais si je mettais à jour php?

1
Axi

Je l'ai résolu en téléchargeant le package .deb

$ wget http://launchpadlibrarian.net/319286878/php7.0-bcmath_7.0.18-0ubuntu0.16.04.1_AMD64.deb
--2017-09-27 16:11:01--  http://launchpadlibrarian.net/319286878/php7.0-bcmath_7.0.18-0ubuntu0.16.04.1_AMD64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 91.189.89.228, 91.189.89.229
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|91.189.89.228|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15726 (15K) [application/x-debian-package]
Saving to: ‘php7.0-bcmath_7.0.18-0ubuntu0.16.04.1_AMD64.deb’

php7.0-bcmath_7.0.18-0ubuntu0.16.04.1_AMD64.deb           100%[====================================================================================================================================>]  15.36K  --.-KB/s    in 0.007s  

2017-09-27 16:11:01 (2.09 MB/s) - ‘php7.0-bcmath_7.0.18-0ubuntu0.16.04.1_AMD64.deb’ saved [15726/15726]

$

et l'installer ...

$ Sudo dpkg -i php7.0-bcmath_7.0.18-0ubuntu0.16.04.1_AMD64.deb
Selecting previously unselected package php7.0-bcmath.
(Reading database ... 127511 files and directories currently installed.)
Preparing to unpack php7.0-bcmath_7.0.18-0ubuntu0.16.04.1_AMD64.deb ...
Unpacking php7.0-bcmath (7.0.18-0ubuntu0.16.04.1) ...
Setting up php7.0-bcmath (7.0.18-0ubuntu0.16.04.1) ...

Creating config file /etc/php/7.0/mods-available/bcmath.ini with new version
Processing triggers for php7.0-fpm (7.0.18-0ubuntu0.16.04.1) ...
$

simple et rapide

$ apt-cache policy php7.0-bcmath
php7.0-bcmath:
  Installed: 7.0.18-0ubuntu0.16.04.1
  Candidate: 7.0.22-0ubuntu0.16.04.1
  Version table:
     7.0.22-0ubuntu0.16.04.1 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial-updates/universe AMD64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/universe AMD64 Packages
 *** 7.0.18-0ubuntu0.16.04.1 100
        100 /var/lib/dpkg/status
     7.0.4-7ubuntu2 500
        500 http://nova.clouds.archive.ubuntu.com/ubuntu xenial/universe AMD64 Packages
$
1
Axi