Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3042  / 3 Years ago, thu, november 18, 2021, 6:05:42

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.

More From » apt

 Answers
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

[#43488] Thursday, November 18, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
erranbe

Total Points: 118
Total Questions: 95
Total Answers: 117

Location: Virgin Islands (U.S.)
Member since Tue, Jul 7, 2020
4 Years ago
;