Alex Chard's picture

Hi all

I need to update our PHP version from 7.0 to 8.2.

I'm trying to follow this thread:
https://www.turnkeylinux.org/forum/support/wed-20220824-1719/update-php-...

However, I have a couple of issues.

When using the line to set the old PHP version, this incorrectly picks up 8.0. 
I manually set that to 7.0.
Doing this yields the correct old and new packages.

Then, when I get to the Set up sury.org PHP section, that script fails with a bunch of errors.

Below is the output from running those commands.

Any help would be greatly appreciated.


root@nginx-php-fastcgi /etc# PHPV_NEW=8.2
root@nginx-php-fastcgi /etc# echo $PHPV_NEW
8.2
root@nginx-php-fastcgi /etc# PHPV_OLD=$(apt-cache policy php | sed -n "\|Candidate:| s|.*Candidate: [0-9]\+:\([0-9]\+\.[0-9]\+\).*$|\1|p")
root@nginx-php-fastcgi /etc# echo $PHPV_OLD
8.0
root@nginx-php-fastcgi /etc# PHP_OLD_PKGS=$(apt-cache policy *php${PHPV_OLD}* | grep -v "Installed: (none)" | grep "Installed:" -B1 | sed -n "\|php${PHPV_OLD}| s|^\([a-z0-9\.-]*\).*$|\1|p")
root@nginx-php-fastcgi /etc# echo $PHP_OLD_PKGS

root@nginx-php-fastcgi /etc# PHPV_OLD=7.0
root@nginx-php-fastcgi /etc# echo $PHPV_OLD
7.0
root@nginx-php-fastcgi /etc# PHP_OLD_PKGS=$(apt-cache policy *php${PHPV_OLD}* | grep -v "Installed: (none)" | grep "Installed:" -B1 | sed -n "\|php${PHPV_OLD}| s|^\([a-z0-9\.-]*\).*$|\1|p")
root@nginx-php-fastcgi /etc# echo $PHP_OLD_PKGS
php7.0-cgi php7.0-cli php7.0-gd php7.0-opcache php7.0-common php7.0-json php7.0-mbstring php7.0-readline php7.0-xml php7.0-curl php7.0-mysql
root@nginx-php-fastcgi /etc# PHP_NEW_PKGS=$(echo "$PHP_OLD_PKGS" | sed "s|$PHPV_OLD|$PHPV_NEW|")
root@nginx-php-fastcgi /etc# echo $PHP_NEW_PKGS
php8.2-cgi php8.2-cli php8.2-gd php8.2-opcache php8.2-common php8.2-json php8.2-mbstring php8.2-readline php8.2-xml php8.2-curl php8.2-mysql
root@nginx-php-fastcgi /etc# curl -sSL https://packages.sury.org/php/README.txt | bash -x
++ whoami
+ '[' root '!=' root ']'
+ apt-get update
Ign:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Err:3 http://security.debian.org stretch/updates Release
  404  Not Found [IP: 199.232.26.132 80]
Err:4 http://deb.debian.org/debian stretch Release
  404  Not Found [IP: 199.232.26.132 80]
Hit:5 http://mirror2.hs-esslingen.de/mariadb/repo/10.4/debian stretch InRelease
Ign:6 https://packages.sury.org/nginx-mainline stretch InRelease
Ign:7 http://archive.turnkeylinux.org/debian stretch-security InRelease
Ign:8 https://packages.sury.org/php stretch InRelease
Err:9 https://packages.sury.org/nginx-mainline stretch Release
  403  Forbidden
Ign:10 http://archive.turnkeylinux.org/debian stretch InRelease
Err:11 https://packages.sury.org/php stretch Release
  403  Forbidden
Ign:12 http://ftp.us.debian.org/debian stretch-backports InRelease
Hit:13 http://archive.turnkeylinux.org/debian stretch-security Release
Err:14 http://ftp.us.debian.org/debian stretch-backports Release
  404  Not Found [IP: 208.80.154.139 80]
Err:15 http://archive.turnkeylinux.org/debian stretch-security Release.gpg
  The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
Hit:16 http://archive.turnkeylinux.org/debian stretch Release
Err:17 http://archive.turnkeylinux.org/debian stretch Release.gpg
  The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
Reading package lists... Done
E: The repository 'http://security.debian.org stretch/updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://deb.debian.org/debian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://packages.sury.org/nginx-mainline stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://packages.sury.org/php stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ftp.us.debian.org/debian stretch-backports Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.turnkeylinux.org/debian stretch-security Release: The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.turnkeylinux.org/debian stretch Release: The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
+ apt-get -y install lsb-release ca-certificates curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20200601~deb9u2).
curl is already the newest version (7.52.1-5+deb9u16).
lsb-release is already the newest version (9.20161125).
The following packages were automatically installed and are no longer required:
  libevent-2.0-5 libfile-copy-recursive-perl linux-image-4.9.0-14-amd64 linux-image-4.9.0-15-amd64
  linux-image-4.9.0-16-amd64 linux-image-4.9.0-17-amd64 openbsd-inetd update-inetd
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 93 not upgraded.
+ curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
+ sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
+ apt-get update
Ign:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Err:3 http://security.debian.org stretch/updates Release
  404  Not Found [IP: 199.232.26.132 80]
Err:4 http://deb.debian.org/debian stretch Release
  404  Not Found [IP: 199.232.26.132 80]
Hit:5 http://mirror2.hs-esslingen.de/mariadb/repo/10.4/debian stretch InRelease
Ign:6 http://archive.turnkeylinux.org/debian stretch-security InRelease
Ign:7 https://packages.sury.org/nginx-mainline stretch InRelease
Ign:8 https://packages.sury.org/php stretch InRelease
Ign:9 http://ftp.us.debian.org/debian stretch-backports InRelease
Ign:10 http://archive.turnkeylinux.org/debian stretch InRelease
Err:11 https://packages.sury.org/nginx-mainline stretch Release
  403  Forbidden
Err:12 https://packages.sury.org/php stretch Release
  403  Forbidden
Hit:13 http://archive.turnkeylinux.org/debian stretch-security Release
Err:14 http://ftp.us.debian.org/debian stretch-backports Release
  404  Not Found [IP: 64.50.233.100 80]
Err:15 http://archive.turnkeylinux.org/debian stretch-security Release.gpg
  The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
Hit:16 http://archive.turnkeylinux.org/debian stretch Release
Err:17 http://archive.turnkeylinux.org/debian stretch Release.gpg
  The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
Reading package lists... Done
E: The repository 'http://security.debian.org stretch/updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://deb.debian.org/debian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://packages.sury.org/nginx-mainline stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://packages.sury.org/php stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ftp.us.debian.org/debian stretch-backports Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.turnkeylinux.org/debian stretch-security Release: The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.turnkeylinux.org/debian stretch Release: The following signatures were invalid: EXPKEYSIG 85C25E95A16EB94D Turnkey Linux Release Key <release@turnkeylinux.com>
root@nginx-php-fastcgi /etc#
 

Forum: 
Tags: 
Alex Chard's picture

This was due to us still being on debian stretch

Jeremy Davis's picture

Hi Alex, glad you got it sorted.

It's perhaps noting that the v18.0 Nginx appliance includes PHP8.2 (installed from Debian repos so get's auto sec updates) OOTB if that's of any value to you?!

Add new comment