instale o módulo php7.0 com a versão antiga específica sem atualizar o php

1

Meu ambiente de produção tem o php7.0.18-0ubuntu0.16.04.1, estou tentando instalar um novo módulo (php7.0-bcmath) mas não consigo encontrar uma maneira de instalá-lo na mesma versão que eu já tenho para 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 parece com o pacote de versão com a instalação do Ubuntu.

Política para o 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
$

Se eu tentar instalar o bcmath, também atualizarei o 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])
$

E se eu tentar forçar uma versão:

$ 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
$

Atualizar para o php7.0.22 é a (boa) solução, eu sei, mas existe alguma maneira de instalar este módulo sem o tempo de inatividade que eu terei se eu atualizar o php?

    
por Axi 27.09.2017 / 15:31

1 resposta

1

Eu resolvi isso baixando o pacote .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]

$

e instalando-o ...

$ 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) ...
$

simples e rápido

$ 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
$
    
por Axi 27.09.2017 / 16:23