Ded*_*oho 13 package-management apt ppa 22.10
我已按照本教程在 Ubuntu 22.10 上安装 php7.4。
据我所知,我只需要添加这个 PPA 并更新我的存储库
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
然后安装 php7.4
sudo apt-get instal php7.4
Run Code Online (Sandbox Code Playgroud)
但是,我收到此错误:
nugroho@vostro:~$ sudo apt-get update
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Ign:2 https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic InRelease
Err:3 https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic Release
404 Not Found [IP: 185.125.190.52 443]
Hit:4 http://archive.ubuntu.com/ubuntu kinetic InRelease
Get:5 http://archive.ubuntu.com/ubuntu kinetic-updates InRelease [90,7 kB]
Hit:6 http://archive.ubuntu.com/ubuntu kinetic-backports InRelease
Get:7 http://archive.ubuntu.com/ubuntu kinetic-security InRelease [90,7 kB]
Reading package lists... Done
E: The repository 'https://ppa.launchpadcontent.net/ondrej/php/ubuntu kinetic 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.
Run Code Online (Sandbox Code Playgroud)
和
nugroho@vostro:~$ sudo apt-get install php7.4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package php7.4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php7.4' has no installation candidate
Run Code Online (Sandbox Code Playgroud)
Ubuntu 22.10 尚不支持 php7.4,还是我弄错了?
以下是有关我的安装的一些详细信息:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.10
Release: 22.10
Codename: kinetic
Run Code Online (Sandbox Code Playgroud)
小智 16
我已按照以下步骤操作,效果很好!(感谢 Item-alert reddit 链接)
从 22.04 升级到 22.10 和 php 5.6 后,我遇到了同样的问题。(在我的例子中是 php 7.4)我通过更改/etc/apt/sources.list.d/ondrej-ubuntu-php-kinetic.list.
deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main
#deb-src https://ppa.launchpadcontent.net/ondrej/php/ubuntu/kinetic main
Run Code Online (Sandbox Code Playgroud)
当然,运行 apt update 命令
这里有几个因素在起作用。
首先,PHP版本默认遵循Ubuntu。因此,Ubuntu 22.10 上除 8 之外的任何 PHP 安装都是非默认安装。
一种方法是使用ppa:ondrej/php. 但是,每个发行版都需要更新 PPA,但 22.10 尚未更新。
另一种选择是使用容器安装 PHP(可能还有 Apache 等)。在这种情况下,PHP版本可以独立于系统。
不建议手动安装非默认 PHP 版本,因为从长远来看,它可能会导致包依赖性问题。
| 归档时间: |
|
| 查看次数: |
26061 次 |
| 最近记录: |