I am running Debian 12 with PHP 8.2. I am attempting to install php8.2-gmp PHP module. So I tried:
apt-get install php8.2-gmp
There was a problem with the sury key being expired in February. See this issues page:
So I went to the sury issues page and they suggested installing this fake key:
apt install debsuryorg-archive-keyring
But the fake key would not install due to a cache problem. I learned that the sury package caches are in /var/lib/apt/lists/. So I deleted all four sury files and tried to install the fake archive key again.
apt install debsuryorg-archive-keyring
This time the fake archive key was installed. I then tried to install the GMP module:
apt-get install php8.2-gmp
I learned that there was a dependency. I first need to install php8.2-common. So I tried
apt-get install php8.2-common
The reply was it is already the newest version 8.2.10. It turns out
php8.2-gmp depends on an older version of php8.2-common (= 8.2.7-1~deb12u1).
I figured out how to install the older version with:
wget ‘http://ftp.de.debian.org/debian/pool/main/p/php8.2/php8.2-common_8.2.7-1~deb12u1_amd64.deb’ && dpkg --install php8.2-common_8.2.7-1~deb12u1_amd64.deb
The above command worked. But it led to a broken package.
E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution). So I tried
apt --fix-broken install.
The reply was that the following packages will be REMOVED:
php8.2 php8.2-apcu php8.2-bcmath php8.2-bz2 php8.2-cli php8.2-curl php8.2-fpm
php8.2-gd php8.2-imagick php8.2-imap php8.2-intl php8.2-ldap php8.2-mbstring
php8.2-mysql php8.2-opcache php8.2-pspell php8.2-readline php8.2-soap php8.2-xml
php8.2-zip
I am pretty certain that getting rid of all of these modules would crash my server. So I typed n for no.
I am hoping someone here might have an idea for how I can install the php8.2-gmp PHP module.