Whenever I try to install php5-curl using apt-get, I get the following error :

E: Failed to fetch http://ubuntu.ntc.net.np/ubuntu/pool/main/p/php5/php5-curl_5.6.4+dfsg-4ubuntu6.4_amd64.deb 403 Forbidden

I also tried to install the package manually using dpkg by downloading the .deb file from http://packages.ubuntu.com but that gave a different kind of dependency error.

dpkg: dependency problems prevent configuration of php5-curl: php5-curl depends on phpapi-20090626; however: Package phpapi-20090626 is not installed.

And running sudo apt-get -f install did not help fix the dependency issue.Is there any other way of installing this package? What do I do?

  • 1
    What Ubuntu version are you on? Also, have you tried using other mirrors instead of the one you're currently using to see if the issue is resolved there? (Use a country level mirror) – Thomas Ward Feb 26 '16 at 15:09
  • That worked! Actually I had to switch to the main server's mirror from my country level mirror JUST to install this one package. Thanks for your help! Any idea what could have caused this? I use 15.04, by the way. – Sandeep Neupane Feb 26 '16 at 17:28
  • 15.04 went End of Life. You will need to upgrade your OS to get continued support. Refer to this thread on Meta for details: "EOL Notice: Vivid Vervet (15.04) is now EOL as of February 4, 2016". Note that as your question is not Ubuntu-version-specific I have not marked it for closure; however you should NOT continue to use 15.04 – Thomas Ward Feb 26 '16 at 17:39
up vote 0 down vote accepted

The issue is likely an issue on that specific mirror, or with something that's out of sync, or otherwise. Unfortuantely, there's no way to determine the cause from here.

The easiest solution, which is usually the most effective, is to switch which apt mirror you use for your Debian sources - if all else fails, archive.ubuntu.com is a usable mirror, and is in fact the main mirror. This should then resolve the situation.

Looking more closely, it looks like there is no "p" folder on that specific mirror - therefore it just "refuses" to list the directory and file, and returns 403 by default. My guess is an out-of-sync mirror, or an incomplete mirror. Given this, I would not be using the ubuntu.ntc.net.np mirror for anything, especially given it is not listed as an official Ubuntu mirror. Just use the main archives instead.

403 Forbidden errors seem to happen almost at random. It could be a server bug, or someone could be filtering your internet connection at any level between you and the destination server. Since I don't know your actual location or connection configuration, I have no idea what is causing this error. On this, the best advice I can offer is to try a different mirror.

As for the dependency error, this page-

https://packages.debian.org/squeeze/phpapi-20090626

-states that phpapi-20090626 is a 'Virtual Package.' This means that it isn't actually the name of a real package - instead, this package name is used to define a specific functionality common to a number of packages. The page also lists several packages that provide this functionality. You might try installing one or more of these listed packages, then attempting to install the .deb file again.

Hope this helps!

  • This doesn't answer the actual question. You are also pulling from the wrong set of package data - Ubuntu and Debian have separate repositories. – Thomas Ward Feb 26 '16 at 15:32
  • Well... In case you didn't remember, Ubuntu is directly BASED on Debian. A .deb on Debian is the same .deb as the .deb in Ubuntu. The two have many packages in common. If it fixes the problem, it doesn't matter what repository it comes from - a .deb package is a .deb package. – Adam Hayes Feb 26 '16 at 15:48
  • You probably aren't aware that I do a lot of work in Ubuntu with the SErver Team - I'm well aware it's based on Debian. Squeeze is ancient, and I don't think it matches up with Ubuntu at all. Not for any current releases anyways. You also don't provide a full answer to the user - how do they know which PHP package to specificially install to provide the virtual package? That's not answered here - so therefore the answer is incomplete. – Thomas Ward Feb 26 '16 at 15:52
  • I just now saw your rep level. Duly noted. However, this is the best help I can provide at my experience level, which is intermediate at best. Perhaps someone with more knowledge than myself can give a more detailed explanation and provide a definitive solution. – Adam Hayes Feb 26 '16 at 16:07

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.