我最近尝试安装最新版本的 PHP,即 8.3.6,但之前我清除了之前的 php8.3.4,现在当我尝试运行
sudo apt install php -y
它说:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libapache2-mod-php8.3 php8.3 php8.3-cli php8.3-common php8.3-opcache php8.3-readline
Suggested packages:
php-pear
The following NEW packages will be installed:
libapache2-mod-php8.3 php php8.3 php8.3-cli php8.3-common php8.3-opcache php8.3-readline
0 upgraded, 7 newly installed, 0 to remove and 4 not upgraded.
Need to get 4,923 kB/4,959 kB of archives.
After this operation, 22.3 MB of additional disk space will be used.
Err:1 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-common amd64 8.3.4-1+ubuntu22.04.1+deb.sury.org+1
404 Not Found [IP: 185.125.190.80 443]
Err:2 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-opcache amd64 8.3.4-1+ubuntu22.04.1+deb.sury.org+1
404 Not Found [IP: 185.125.190.80 443]
Err:3 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-readline amd64 8.3.4-1+ubuntu22.04.1+deb.sury.org+1
404 Not Found [IP: 185.125.190.80 443]
Err:4 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-cli amd64 8.3.4-1+ubuntu22.04.1+deb.sury.org+1
404 Not Found [IP: 185.125.190.80 443]
Err:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 libapache2-mod-php8.3 amd64 8.3.4-1+ubuntu22.04.1+deb.sury.org+1
404 Not Found [IP: 185.125.190.80 443]
E: Failed to fetch https://ppa.launchpadcontent.net/ondrej/php/ubuntu/pool/main/p/php8.3/php8.3-common_8.3.4-1%2bubuntu22.04.1%2bdeb.sury.org%2b1_amd64.deb 404 Not Found [IP: 185.125.190.80 443]
E: Failed to fetch https://ppa.launchpadcontent.net/ondrej/php/ubuntu/pool/main/p/php8.3/php8.3-opcache_8.3.4-1%2bubuntu22.04.1%2bdeb.sury.org%2b1_amd64.deb 404 Not Found [IP: 185.125.190.80 443]
E: Failed to fetch https://ppa.launchpadcontent.net/ondrej/php/ubuntu/pool/main/p/php8.3/php8.3-readline_8.3.4-1%2bubuntu22.04.1%2bdeb.sury.org%2b1_amd64.deb 404 Not Found [IP: 185.125.190.80 443]
E: Failed to fetch https://ppa.launchpadcontent.net/ondrej/php/ubuntu/pool/main/p/php8.3/php8.3-cli_8.3.4-1%2bubuntu22.04.1%2bdeb.sury.org%2b1_amd64.deb 404 Not Found [IP: 185.125.190.80 443]
E: Failed to fetch https://ppa.launchpadcontent.net/ondrej/php/ubuntu/pool/main/p/php8.3/libapache2-mod-php8.3_8.3.4-1%2bubuntu22.04.1%2bdeb.sury.org%2b1_amd64.deb 404 Not Found [IP: 185.125.190.80 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
不幸的是,我尝试了所有命令,例如--fix-missing、apt update、upgrade,除了php之外,一切运行良好。
先感谢您。
这是
sudo apt update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://dz.archive.ubuntu.com/ubuntu jammy InRelease
Hit:4 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Get:5 https://download.docker.com/linux/ubuntu groovy InRelease [43.3 kB]
Hit:6 https://ppa.launchpadcontent.net/linuxuprising/java/ubuntu jammy InRelease
Get:7 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:8 http://dz.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:9 http://dz.archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:10 http://us.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Hit:12 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:11 https://packages.emqx.com/emqx/emqx/ubuntu jammy InRelease
Fetched 272 kB in 3s (98.7 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
谢谢。
其结果是:
sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
gsasl-common node-ip libavdevice58 ffmpeg libpostproc55 libswscale-dev
libgsasl7 libavcodec58 traceroute libavutil56 libswscale5 libavutil-dev
libswresample3 libavformat58 libavformat-dev libavcodec-dev
libswresample-dev libavfilter7
Learn more about Ubuntu Pro at https://ubuntu.com/pro
The following packages have been kept back:
distro-info-data python3-update-manager update-manager update-manager-core
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
谢谢
答案1
删除 PPA 并重新安装应该可以解决问题,因为 404 错误表明安装的 PPA 版本不再存在。
- 让我们尝试删除有问题的 PPA:
sudo add-apt-repository --remove ppa:ondrej/php
- 重新同步所有存储库:
sudo apt update
- 升级持有的包裹:
sudo apt install distro-info-data python3-update-manager update-manager update-manager-core
- 现在升级:
sudo apt upgrade
- 重新安装 PPA:
sudo add-apt-repository ppa:ondrej/php
- 再次同步存储库:
sudo apt update
这应该会更新 PPA 的 IP 地址。