I just started to explore debian for the first time, and wondered if anyone knew anything about the "unable to locate packages" I get this error when I am trying to run ./installer.sh (a file)

E: Unable to locate package php
E: Unable to locate package libapache2-mod-php
E: Unable to locate package php-mcrypt
E: Unable to locate package php-gnupg
E: Unable to locate package php-mysql
E: Unable to locate package php-gmp
E: Unable to locate package php-curl
E: Unable to locate package php-bcmath
E: Unable to locate package php-gd

I tried to do sudo commands.

I am using debian 7.11 x64 on my server


closed as unclear what you're asking by GAD3R, user34720, Jeff Schaller, Timothy Martin, DarkHeart Mar 1 '18 at 0:33

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Welcome to U&L. What is the output of cat /etc/apt/sources.list? What is the content of installer.sh ?You can edit here – GAD3R Feb 27 '18 at 19:12
  • I think the script should be used only on Ubuntu not on debian. – GAD3R Feb 27 '18 at 19:23

Your installer.sh is a script for installing some piece of software I take it? This installer script appears to be dependent on all of the packages it is listing that it cannot find.

Try running this series of commands:

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-gnupg php5-mysqlnd php5-gmp php5-curl php5-bcmath php5-gd

Then try running ./installer.sh again after you have verified that you have installed all the packages required and have met their dependencies.

One issue you may encounter is that your version of Debian may not have the necessary packages. This site here has a list of all the Debian "Wheezy" Packages. Search for the packages on that site to verify if they are available. You may need to add non-free and contrib to your sources.list. If you cannot find them on any of those repos then you will need to install the aforementioned packages manually or upgrade to a newer version of Debian.

Debian 7 is reaching the end of support here soon so it is recommended you upgrade to a newer version of Debian but that is another issue separate from this. I cannot recommend installing that many packages manually as it could lead to certain issues. Best of Luck!

  • 1
    Been a while since I've used Debian 7, but IIRC weren't the packages named php5-foo ? IE, php5-mysql and php5-mcrypt etc ? – ivanivan Feb 27 '18 at 19:27
  • I can update the answer to reflect this. – kemotep Feb 27 '18 at 19:28
  • Just checked via the link in your answer - no, they hadn't moved to the php5- naming in Wheezy. Jessie did that.... – ivanivan Feb 27 '18 at 19:30
  • @ivanivan It also appears that without additional information to the user's sources.list and the requirements of the installer.sh a satisfactory answer can not be produced. – kemotep Feb 27 '18 at 19:34

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