4

I want to install phpize for PHP7 on Ubuntu 14.0.4 so I am running the following command:

sudo apt-get install php7.0-dev

But I am getting following errors:

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?

Any ideas as to how can i fix these errors ?

4 Answers 4

13

If you are coming from the old obsolete repository then remove it

# apt-get install ppa-purge
# ppa-purge ppa:ondrej/php-7.0

Add the new repository and update

# add-apt-repository ppa:ondrej/php
# apt-get update
# apt-get upgrade
# apt-get autoremove

I also had to restart Apache to get things working again after upgrading

# service apache2 restart
2
  • 1
    Worked for me on the scotch.io vagrant box. Thanks for sharing! Nov 6, 2016 at 23:00
  • I just followed this this after failing to install imagemagick on a homestead vagrant box with similar errors to above. Be warned it buggered things up a bit and I had to go through re-installing things like mcrypt. Not totally sure why yet, but anyone finding this through Google tread carefully :) Nov 8, 2016 at 12:33
12

You are using an obsolete PPA: ondrej/php-7.0

Use ppa:ondrej/php Instead

First disable the obsolete PPA and reverts to official packages

sudo apt-get install python-software-properties
sudo ppa-purge ppa:ondrej/php-7.0

Then

sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.0-dev
2
  • it says ppa-purge command not found. when i search for how can i install that command, i see ways like sudo apt-get update. But that command gives me same error Mar 4, 2016 at 7:56
  • 2
    @ReenaParekh Try installing python-software-properties. If that don't work just run the last two lines. That'll do Mar 4, 2016 at 8:00
2

The command "ppa-purge" does not work for deleted repositories, the correct one is to delete the files manually that are located in the "sources.list.d" and they start with the word "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
1
  • Welcome to AskUbuntu. Would you mind adding a explanation what your commands do and why it fixes the problem? Thank you :)
    – MadMike
    Jun 20, 2016 at 12:04
1

For similar problems while using a docker, you need to build your docker with the option --no-cache.

Here is the trace I had before doing it:

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?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .