我想在 Ubuntu 14.0.4 上为 PHP7 安装 phpize,因此我运行以下命令:
sudo apt-get install php7.0-dev
但我收到以下错误:
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/p/php7.0/php7.0-common_7.0.3-5+deb.sury.org~trusty+1_all.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/p/php7.0/php7.0-cli_7.0.3-5+deb.sury.org~trusty+1_amd64.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/p/php-pear/php-pear_1.10.1+submodules+notgz-3+deb.sury.org~trusty+3_all.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/p/php7.0/php7.0-dev_7.0.3-5+deb.sury.org~trusty+1_amd64.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php-7.0/ubuntu/pool/main/d/dh-php/dh-php_0.6+deb.sury.org~trusty+1_all.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
关于如何修复这些错误有什么想法吗?
答案1
如果你来自旧的过时的存储库,请将其删除
# apt-get install ppa-purge
# ppa-purge ppa:ondrej/php-7.0
添加新的存储库并更新
# add-apt-repository ppa:ondrej/php
# apt-get update
# apt-get upgrade
# apt-get autoremove
升级后,我还必须重新启动 Apache 才能恢复正常运行
# service apache2 restart
答案2
您正在使用过时的 PPA:ondrej/php-7.0
使用ppa:ondrej/php反而
首先禁用过时的 PPA 并恢复到官方软件包
sudo apt-get install python-software-properties
sudo ppa-purge ppa:ondrej/php-7.0
然后
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0-dev
答案3
命令“ppa-purge”对已删除的存储库不起作用,正确的方法是手动删除位于“sources.list.d”中以单词“ondrej”开头的文件
# "ppa-purge" don't work for deleted repositories
# Delete old ondrej repositories
sudo rm /etc/apt/sources.list.d/ondrej*
# Add new updated ppa
sudo add-apt-repository ppa:ondrej/php
# Update apt-cache
sudo apt-get update
# Update packages
sudo apt-get upgrade
# Restart apache or nginx (change apache2 for nginx)
sudo service apache2 restart
答案4
对于使用 docker 时遇到的类似问题,您需要使用选项构建您的 docker --no-cache
。
这是我做这件事之前的痕迹:
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-intl_7.1.13-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mbstring_7.1.13-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-mysql_7.1.13-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-soap_7.1.13-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.1/php7.1-sqlite3_7.1.13-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?