执行添加php源命令

add-apt-repository ppa:ondrej/php

出现如下错误

命中:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
命中:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
命中:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
命中:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
命中:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
命中:6 https://pkg.ltec.ch/public bionic InRelease
命中:7 https://esm.ubuntu.com/infra/ubuntu bionic-infra-security InRelease
命中:8 https://esm.ubuntu.com/infra/ubuntu bionic-infra-updates InRelease
忽略:9 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease
命中:10 https://download.docker.com/linux/ubuntu bionic InRelease
错误:11 http://ppa.launchpad.net/ondrej/php/ubuntu jammy Release
  404  Not Found [IP: 91.189.95.85 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/ondrej/php/ubuntu jammy Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

解决方法

跳转到源列表存放的目录

cd /etc/apt/sources.list.d/

修改一下源的文件名

mv ondrej-ubuntu-php-jammy.list ondrej-ubuntu-php-bionic.list

编辑php源

nano ondrej-ubuntu-php-bionic.list

把里面的 jammy 修改为 bionic(就像下面这样)

deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main

保存

执行apt更新

apt update
命中:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
命中:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
命中:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
命中:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
命中:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
命中:6 https://download.docker.com/linux/ubuntu bionic InRelease
命中:7 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
命中:8 https://esm.ubuntu.com/infra/ubuntu bionic-infra-security InRelease
命中:9 https://esm.ubuntu.com/infra/ubuntu bionic-infra-updates InRelease
命中:10 https://pkg.ltec.ch/public bionic InRelease
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
所有软件包均为最新。

正常更新 不再报错 问题解决

接下来正常执行apt install就行了

发表评论

电子邮件地址不会被公开。 必填项已用*标注