首页 文章

无法在Debian 9(Stretch)上安装php 7.2

提问于
浏览
0

我添加了存储库来在Debian Stretch上安装php 7.2 .

sudo apt install apt-transport-https lsb-release ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update

但是当我运行apt update时 - 我收到一个错误:

E: The repository 'https://packages.sury.org/php stretch Release' does not have a Release file.

据我了解,问题出在我的环境中 .
但无法弄清楚是什么问题 .

PS:

我的/etc/apt/sources.list:

# deb http://ftp.de.debian.org/debian/ jessie main
# deb http://ftp.de.debian.org/debian/ buster main
deb http://ftp.de.debian.org/debian/ stretch main
deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb http://ftp.by.debian.org/debian/ stretch-updates main
deb http://mirror.yandex.ru/debian/ stretch-backports main contrib non-free
deb http://ftp.debian.org/debian/ stretch-backports main
deb http://dl.winehq.org/wine-builds/debian/ stretch main

/etc/apt/sources.list.d目录中有php.list,其中包含以下行:

deb https://packages.sury.org/php/ stretch main

2 回答

  • 2

    如果它有帮助,这些是几个小时前我在Debian Stretch上安装php 7.2的确切步骤(或多或少类似于你):

    sudo apt install ca-certificates apt-transport-https
    wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
    echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
    cd /etc/apt/sources.list.d/
    sudo mv ondrej-ubuntu* /tmp
    sudo apt -y update
    sudo apt install php7.2
    
  • 0

    如果您在 /etc/apt/sources.list.d/ 目录中找到下面列出的文件,请将其删除并重试:

    ondrej-ubuntu-apache2-cosmic.list
    ondrej-ubuntu-php-cosmic.list
    ondrej-ubuntu-php-cosmic.list.save
    

相关问题