skip to Main Content

I have added

packages.sury.org/php

through the script, I got on deb.sury.org

===========================================

#!/bin/sh
# To add this repository please do:

if [ "$(whoami)" != "root" ]; then
    SUDO=sudo
fi

${SUDO} apt-get update
${SUDO} apt-get -y install apt-transport-https lsb-release ca-certificates curl
${SUDO} curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
${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'
${SUDO} apt-get update

===========================================

After running the script is gives an error:

Ign:5 https://packages.sury.org/php kali-rolling InRelease

Err:6 https://packages.sury.org/php kali-rolling Release

404  Not Found [IP: 102.129.144.44 443]

and then continues.
I can’t even add the ubuntu repo it gives the same result and I think that one is one is worse.

I also add [trusted=yes] to the php.list file in /etc/apt/sources.list.d/ directory

It gives an even longer error.
Any help is much appreciated

2

Answers


  1. Run as root:

    #!/bin/sh
    set -e
    
    rm -f /usr/share/keyrings/deb.sury.org-php.gpg
    rm -f /etc/apt/sources.list.d/php.list
    
    apt-get update
    apt-get -y install apt-transport-https ca-certificates curl
    curl -sSLo /etc/apt/trusted.gpg.d/sury-php.gpg https://packages.sury.org/php/apt.gpg
    echo "deb https://packages.sury.org/php/ bullseye main" > /etc/apt/sources.list.d/sury-php.list
    apt-get update
    

    Officially, the https://packages.sury.org/php/ repo directory only supports the following distribution names: bullseye, buster and stretch. And you have Kali Linux. I replaced the Kali Linux release name with the Debian release name.

    Login or Signup to reply.
  2. In order to dynamically install php (or other packages) follow these steps:

    1. Install lsb_release package (this command will help you to get the code name of the linux distribution installed on your computer):

      apt install -y lsb-release
      
    2. Run this command:

      echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
      
    3. Run apt update in order to add this repository to your repositories and now you can install php using apt install php command.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search