0

I have my PHP Version pinned at 5.2.x, Here is the command line output

php -version
PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Running this command to install php5-mhash:

sudo apt-get install php5-mhash

Here is the error message

Reading package lists... Done Building dependency tree        Reading
state information... Done Some packages could not be installed. This
may mean that you have requested an impossible situation or if you are
using the unstable distribution that some required packages have not
yet been created or been moved out of Incoming. The following
information may help to resolve the situation:

The following packages have unmet dependencies:   php5-mhash: Depends:
php5-common (= 5.2.10.dfsg.1-2ubuntu6.10) but 5.2.10.dfsg.1-2ubuntu6
is to be installed E: Broken packages

My question is how do I fix this? Can I install an older version of php5-mhash and if so, how do I do that?

Here is the output from running: sudo apt-get install -f:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
7
  • Try running sudo apt-get install -a, then running sudo apt-get install php5-mhash. Sep 15, 2011 at 15:24
  • sudo apt-get install -a E: Command line option 'a' [from -a] is not known. Sep 15, 2011 at 15:32
  • Did you mean sudo apt-get install -f ?, added output to question Sep 15, 2011 at 15:32
  • Oups, yes... Gah. Sorry. Sep 15, 2011 at 15:38
  • still the same error Sep 15, 2011 at 15:41

2 Answers 2

2

Well if anyone is facing this problem I figured it out.

Download and install it manually

Here are the steps:

(I'm using the Karmic Repo to match the version I have pinned)

Download the matching version from here. Installed on my box is this version php-common 5.2.10.dfsg.1-2ubuntu6 So this is the version I downloaded

Then I manually installed the package like this:

sudo dpkg -i php5-mhash_5.2.10.dfsg.1-2ubuntu6_i386.deb

Output:

Selecting previously deselected package php5-mhash. (Reading database
... 357032 files and directories currently installed.) Unpacking
php5-mhash (from php5-mhash_5.2.10.dfsg.1-2ubuntu6_i386.deb) ...
Setting up php5-mhash (5.2.10.dfsg.1-2ubuntu6) ...

Note: I did install the wrong version before finding the correct version to download and install. The output was something like this:

$ sudo dpkg -i php5-mhash_5.2.6.dfsg.1-3ubuntu4_i386.deb  
Selecting previously deselected package php5-mhash.
(Reading database ... 357032 files and directories currently installed.)
Unpacking php5-mhash (from php5-mhash_5.2.6.dfsg.1-3ubuntu4_i386.deb) ...
dpkg: dependency problems prevent configuration of php5-mhash:
  php5-mhash depends on php5-common (= 5.2.6.dfsg.1-3ubuntu4); however:
    Version of php5-common on system is 5.2.10.dfsg.1-2ubuntu6.
dpkg: error processing php5-mhash (--install):
  dependency problems - leaving unconfigured
Errors were encountered while processing:  php5-mhash

Running this to fix the broken install:

sudo apt-get -f install

Output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer
required:
  libmhash2
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  php5-mhash
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 69.6kB disk space will be freed. Do you
want to continue [Y/n]? y
(Reading database ... 357033 files and directories currently installed.)
Removing php5-mhash
0

Just rename /etc/php5/mods-available/pdo.ini and also /usr/lib/php5.

1
  • 2
    Can you please explain why this will fix it?
    – jrg
    Mar 2, 2012 at 14:51

You must log in to answer this question.

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