parrot os Unable to locate /install php package 8.1

1.2k Views Asked by At

I have been trying to install PHP 8+ on my Parrot 5.0 but nothing works.

I tried following Instructions on Digital Ocean

I also tried running and adding the repo sudo add-apt-repository ppa:ondrej/php but it gives me this error described in this issue

Currently, there seems to be no solution on the net. Anyone to help?

1

There are 1 best solutions below

0
Valentine Ifeanyi On

I had the same issue but here is how I solved it:

Enable/Add the Sury repository:

    sudo apt-get update

    sudo apt-get -y install lsb-release ca-certificates curl

    sudo curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg

make some tweaks to the next command so it can work on Parrot OS version 5 which is based on Debian 11 'bullseye',

# change this line
   # sudo 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'

#to this
    sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php bullseye main" > /etc/apt/sources.list.d/php.list'

    sudo apt-get update

I used aptitude for the installation so I can the handle the ummet dependencies error.( I got libpcre2-8-0 error in my case).

Install aptitude:

sudo apt install aptitude

install php and it's dependencies:

sudo aptitude install php8.2 libapache2-mod-php8.2 php8.2-cli

I picked a suitable option from the solutions aptitude suggested.

use y to select an option and n to go to the next available option if the first did not solve it (my first option was- not to install the packages that depended on the libpcre2-8-0)

Because the OS has a default php already installed, I ran:

sudo update-alternatives --config php

and selected the number of the newer version of php from the numbered options (it was numbered 3 in my case).

I hope this solves your problem. Let me know it if you encounter any issues while following the above steps.

For reference, Check the ReadMe on Sury's official repo.