我的系统是 Debian Buster:
~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
我已运行以下命令尝试安装 Php 8.0
sudo apt -y install lsb-release apt-transport-https ca-certificates
sudo apt update && sudo apt upgrade -y
sudo reboot
sudo apt -y install lsb-release apt-transport-https ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
sudo apt -y install php8.0
apt update
然后出现以下错误,导致 php8.0 不是现有包:
Resolving packages.sury.org (packages.sury.org)... 172.67.182.150, 104.21.18.148, 2606:4700:3030::ac43:b696, ...
Connecting to packages.sury.org (packages.sury.org)|172.67.182.150|:443... connected.
GnuTLS: A TLS fatal alert has been received.
GnuTLS: received alert [49]: Access was denied
Unable to establish SSL connection.
我知道这不是网络问题,因为我可以 ping 'google.com' 和 8.8.8.8,还可以从其他第三方下载软件包。我似乎无法弄清楚如何完成这项工作,我愿意使用 Sury 的替代方案来安装 Php 8.0。这是我的问题还是 Sury 的问题?尽管如此,苏里似乎是获取 Php 8.0 的最佳方式。
希望有比我聪明的人知道为什么这不起作用。如果您有任何其他问题,可以评论或私信我。提前谢谢您!
答案1
第一个命令和最后一个命令都有拼写错误(不会安装任何内容):
sudo apt -y install lsb-release apt-transport-https ca-certificates
和sudo apt -y install php8.0
应该-y
在 之后install
。
要安装所需的包,请使用:
sudo apt install -y lsb-release apt-transport-https ca-certificates
下一个:
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
sudo apt install -y php8.0