Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Recently in a bout of frustration with getting phpmyadmin setup, I decided to start from scratch.

Unfortunately, during the uninstall phase, I was prompted with the root password for mysql which I didn't have on hand at the time. Suffice to say, it informed me that there would be residue components since it couldn't properly clean its database connectors.

When I arrived home, I attempted to remove the package through aptitude purge which turns out to no more potent than aptitude remove in that it saw phpmyadmin, attempted to remove it, and failed since the directories associated with the package were already removed from my earlier attempt.

I tried to reinstall phpmyadmin, but aptitude simply stated that there was no update available, and did nothing, if there were an update, I'd probably run into the same problems regardless.

In this regard, I proceeded to clean up mysql by dropping the database it used, and cleaning it from the user tables. I however have no idea what else is left from the package, or even how to clean the hooks in aptitude.

The result of dpkg --purge

ickronia:/home/ken# dpkg --purge phpmyadmin
(Reading database ... 27158 files and directories currently installed.)
Removing phpmyadmin ...
/var/lib/dpkg/info/phpmyadmin.prerm: line 5: /usr/share/dbconfig-common/dpkg/prerm.mysql: No such file or directory
dpkg: error processing phpmyadmin (--purge):
 subprocess pre-removal script returned error exit status 1
/var/lib/dpkg/info/phpmyadmin.postinst: line 35: /usr/share/dbconfig-common/dpkg/postinst.mysql: No such file or directory
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
phpmyadmin

On following Gile's advice, I tried to re-install the dependency dbconfig-common

ickronia:/home/ken# aptitude reinstall dbconfig-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
dbconfig-common is not currently installed, so it will not be reinstalled.
dbconfig-common is not currently installed, so it will not be reinstalled.
The following packages are BROKEN:
  phpmyadmin
0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
The following packages have unmet dependencies:
  phpmyadmin: Depends: php5-mcrypt but it is not installable
              Depends: dbconfig-common but it is not installable
              Depends: libjs-mootools (>= 1.2.4.0~debian1-1) which is a virtual  package.
The following actions will resolve these dependencies:

Remove the following packages:
phpmyadmin

Score is 121

Accept this solution? [Y/n/q/?] n

*** No more solutions available ***

The following actions will resolve these dependencies:

Remove the following packages:
phpmyadmin

Score is 121

Accept this solution? [Y/n/q/?] n

*** No more solutions available ***

The following actions will resolve these dependencies:

Remove the following packages:
phpmyadmin

Score is 121

Accept this solution? [Y/n/q/?] y
The following packages will be REMOVED:
  phpmyadmin{a}
0 packages upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
Need to get 0B of archives. After unpacking 17.7MB will be freed.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
(Reading database ... 27158 files and directories currently installed.)
Removing phpmyadmin ...
/var/lib/dpkg/info/phpmyadmin.prerm: line 5: /usr/share/dbconfig-common/dpkg/prerm.mysql: No such file or directory
dpkg: error processing phpmyadmin (--remove):
 subprocess pre-removal script returned error exit status 1
/var/lib/dpkg/info/phpmyadmin.postinst: line 35: /usr/share/dbconfig-common/dpkg/postinst.mysql: No such file or directory
dpkg: error while cleaning up:
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 phpmyadmin
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done

ickronia:/home/ken#

It appears that phpmyadmin cleanly cleared out dbconfig-common

ickronia:/usr/share/dbconfig-common# ls -alF
total 12
drwxr-xr-x  3 root root 4096 2011-02-09 08:09 ./
drwxr-xr-x 98 root root 4096 2011-01-20 21:42 ../
drwxr-xr-x  3 root root 4096 2011-01-05 11:08 data/
ickronia:/usr/share/dbconfig-common#

Attempted to dpkg from archives as suggested by Giles

ickronia:/usr/share/dbconfig-common# dpkg -i /var/cache/apt/archives/{dbconfig-common,php5-mcrypt,libjs-mootools}*.deb
Selecting previously deselected package dbconfig-common.
(Reading database ... 27161 files and directories currently installed.)
Unpacking dbconfig-common (from .../dbconfig-common_1.8.46_all.deb) ...
Selecting previously deselected package php5-mcrypt.
Unpacking php5-mcrypt (from .../php5-mcrypt_5.3.3-6_i386.deb) ...
Selecting previously deselected package libjs-mootools.
Unpacking libjs-mootools (from .../libjs-mootools_1.2.5~debian1-2_all.deb) ...
Setting up dbconfig-common (1.8.46) ...
dpkg: dependency problems prevent configuration of php5-mcrypt:
 php5-mcrypt depends on libltdl7 (>= 2.2.6b); however:
  Package libltdl7 is not installed.
 php5-mcrypt depends on libmcrypt4; however:
  Package libmcrypt4 is not installed.
dpkg: error processing php5-mcrypt (--install):
 dependency problems - leaving unconfigured
Setting up libjs-mootools (1.2.5~debian1-2) ...
Processing triggers for man-db ...
Processing triggers for libapache2-mod-php5 ...
Reloading web server config: apache2.
Errors were encountered while processing:
 php5-mcrypt
ickronia:/usr/share/dbconfig-common#

I have a webserver running on php, but I'm willing to risk downtime to get this resolved.

share|improve this question
    
Copy-paste the exact commands you tried and the whole output you get. We can probably help you, but not without seeing the exact error messages. –  Gilles Feb 20 '11 at 19:41

4 Answers 4

up vote 4 down vote accepted

phpmyadmin depends on dbconfig-common, which contains /usr/share/dbconfig-common/dpkg/prerm.mysql. It looks like you've managed to uninstall dbconfig-common without uninstalling phpmyadmin, which shouldn't have happened (did you try to --force something?).

My advice is to first try aptitude reinstall dbconfig-common. If it works, you should have a system in a consistent state from which you can try aptitude purge phpmyadmin again.

Another thing you can do is comment out the offending line in /var/lib/dpkg/info/phpmyadmin.prerm. This is likely to make you able to uninstall phpmyadmin. I suspect you did what that line is supposed to do when you edited those mysql tables manually, but I don't know phpmyadmin or database admin in general, so I'm only guessing.

The difference between remove and purge is that remove just removes the program and its data files (the stuff you could re-download), while purge first does what remove does then also removes configuration files (the stuff you might have edited locally). If remove fails, so will purge.

share|improve this answer
    
I recently tried you suggestion on reinstalling dbconfig-common, but to no avail. I've updated my questions with the results of that endeavor. –  Ken Feb 20 '11 at 21:08
    
@Ken: Try dpkg -i /var/cache/apt/archives/{dbconfig-common,php5-mcrypt,libjs-mootools}*.deb. If you don't have the debs in your cache, download them from packages.debian.org . If there are error messages, post them and I (or someone else) might help you with them. –  Gilles Feb 20 '11 at 21:17
    
Attempted to no avail. It seems as if a swarm of locusts have been unleashed on my clean Debian server. Question has been updated to reflect this latest attempt. –  Ken Feb 20 '11 at 21:25
    
@Ken: You need to install the dependencies of php5-mcrypt as well. Aptitude would do the job for you; you can try, but I think it will refuse to budge until you bring php5myadmin to a good state. dpkg is lower level and can operate even on a partially-broken package database. –  Gilles Feb 20 '11 at 21:28
    
In attempting to install php5-mcrypt, It prompted first the removal of phpmyadmin and dbconfig-common. I couldn't get any other solutions so I thought it would fall flat on its face when I agreed. Contrary, simply the act that php5-mycrypt was 'suggested' for install allowed aptitude to properly clean the hooks and remove phpmyadmin and dbconfig-common. I've now since re-installed them along with phpmyadmin (albeit through a tar for more control). It appears that the latest version doesn't require mysql for self-organization. Thank you Giles for removing the locusts from my server! –  Ken Feb 21 '11 at 1:38

(I'm going to assume you meant aptitude purge and apt-get remove, because the commands you cited don't exist)

Try dpkg --purge phpmyadmin. It's lower-level that the other tools, so might be more effective in this case.

share|improve this answer
    
It provided the same result but without the verbose feedback required by aptitude. Thanks for catching my mincing of the command names. –  Ken Feb 20 '11 at 21:11
    
I've got what feels like the same problem but unfortunately I've manually compiled the PHP, Apache, and more so installing these by adding the php5-mcrypt module (which has everything I mentioned as a dependency) would result in a rather messy and unwanted duplication. Is there no other way? –  ken Oct 15 '13 at 13:31

You might want to run 'apt-get -f install' to correct these:

The following packages have unmet dependencies:
 postgresql-client-9.1 : Breaks: postgresql-9.1 (< 9.1.11-0ubuntu0.12.04) but 9.1.10-0ubuntu12.04 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I was facing above problem, using "sudo dpkg --purge postgresql-9.1" command problem solved

share|improve this answer

Sometimes the package management system is so broken (often in a circular dependency chain) that the only combination of commands I have found to remove problematic packages are:

  • cd /var/lib/dpkg/info ; rm <packagename.*>
  • dpkg --purge --force-remove-reinstreq <packagename>
  • OR dpkg --remove --force-remove-reinstreq <packagename>
  • Then apt-get install <packagename> to re-install the package

Sometimes, the state-override file may also need to be fixed, and the above procedure may throw up errors regarding that .. How to fix the state override files depends on whether it is an error flagging a user or not.

Generally:

  • the state override files are in: /var/lib/dpkg/statoverride
  • You can update it by running: dpkg-statoverride --remove <stateoverride-filename>
  • You can even edit them by hand if you know what you are doing
share|improve this answer

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.