您可能会遇到类似于
的错误
Hit:1 http://ng.archive.ubuntu.com/ubuntu lunar InRelease Hit:2 http://ng.archive.ubuntu.com/ubuntu lunar-updates InRelease Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease Hit:4 http://ng.archive.ubuntu.com/ubuntu lunar-backports InRelease Ign:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar InRelease Err:6 https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar Release 404 Not Found [IP: 185.125.190.80 443] Hit:7 http://ng.archive.ubuntu.com/ubuntu lunar-security InRelease Reading package lists... Done E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu lunar Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. or “Reading package lists… Done Building dependency tree Reading state information… Done E: Unable to locate package php8.2 E: Couldn’t find any package by glob ‘php8.2’ E: Couldn’t find any package by regex ‘php8.2’”
可能在运行后
add-apt-repository ppa:ondrej/php
通过运行删除以前的源
sudo add-apt-repository --remove ppa:ondrej/php sudo apt update
您需要按如下方式编辑存储库源文件:
sudo nano /etc/apt/sources.list
并输入
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main
然后运行
sudo apt update
之后您现在应该能够以 8.3 为例安装您的 php 版本
sudo apt install php8.3
如果您已经安装了其他一些 php,您可能需要使用
更改为版本
sudo update-alternatives --config php
然后按照提示操作。
您还可以考虑安装以下扩展
sudo apt install php8.3-curl php8.3-gd php8.3-intl php8.3-simplexml php8.3-dom php8.3-mysql php8.3-mbstring php8.3-xml php8.3-gd php8.3-curl php8.3-mysqli php8.3-zip
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3