Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 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 Install php5-mhash and if so, how do I do that?

I am open to any suggestions.

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.
share|improve this question
    
Try running sudo apt-get install -a, then running sudo apt-get install php5-mhash. –  nickguletskii Sep 15 '11 at 15:24
    
sudo apt-get install -a E: Command line option 'a' [from -a] is not known. –  Phill Pafford Sep 15 '11 at 15:32
    
Did you mean sudo apt-get install -f ?, added output to question –  Phill Pafford Sep 15 '11 at 15:32
    
Oups, yes... Gah. Sorry. –  nickguletskii Sep 15 '11 at 15:38
    
still the same error –  Phill Pafford Sep 15 '11 at 15:41
show 2 more comments

2 Answers 2

up vote 2 down vote accepted

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)

https://launchpad.net/ubuntu/karmic/i386/php5-mhash

Download the matching version, installed on my box is this version of php-common 5.2.10.dfsg.1-2ubuntu6 So this is the version I downloaded:

https://launchpad.net/ubuntu/karmic/i386/php5-mhash/5.2.10.dfsg.1-2ubuntu6

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  <br />

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 ...
share|improve this answer
add comment

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

share|improve this answer
2  
Can you please explain why this will fix it? –  jrg Mar 2 '12 at 14:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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