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

时间:2018-07-11 21:06:59

标签: debian repository stretch php-7.2

我添加了存储库以在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更新时-我收到一个错误:

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 个答案:

答案 0 :(得分:3)

如果有帮助,这些是确切的步骤(或多或少与您的步骤类似),几个小时前我曾在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

答案 1 :(得分:0)

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

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