取出破损的包裹


9

最近由于对phpmyadmin的安装感到沮丧,我决定从头开始。

不幸的是,在卸载阶段,系统提示我输入mysql的root密码,当时我还没有这个密码。可以说,它告知我会有残留成分,因为它无法正确清理其数据库连接器。

当我回到家时,我试图删除该软件包,aptitude purge但结果却没有比aptitude removephpmyadmin 更有效,试图删除它,但由于与该软件包关联的目录已经从我先前的尝试中删除,因此失败了。

我试图重新安装phpmyadmin,但是aptitude简单地指出没有可用的更新,并且什么也不做,如果有更新,无论如何我都可能会遇到相同的问题。

在这方面,我通过删除使用的数据库并从用户表中清除它来清理mysql。但是我不知道包装还剩下什么,甚至不知道如何清洁挂钩。

的结果 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

按照吉尔的建议,我尝试重新安装依赖项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#

看来phpmyadmin彻底清除了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#

尝试根据Giles的建议从档案中dpkg

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#

我有一个在php上运行的网络服务器,但我愿意冒险停机以解决此问题。


复制并粘贴您尝试的确切命令以及获得的整个输出。我们可能会为您提供帮助,但一定会看不到确切的错误消息。
吉尔(Gilles)'所以

Answers:


7

phpmyadmin取决于dbconfig-common,其中包含/usr/share/dbconfig-common/dpkg/prerm.mysql。看来您已经成功卸载dbconfig-common而不卸载了phpmyadmin,这不应该发生(您是否尝试--force过?)。

我的建议是先尝试aptitude reinstall dbconfig-common。如果可行,您应该使系统处于一致状态,然后可以从中重试aptitude purge phpmyadmin

您可以做的另一件事是在中注释掉违规行/var/lib/dpkg/info/phpmyadmin.prerm。这很可能使您能够卸载phpmyadmin。我怀疑您手动编辑了这些mysql表时做了那行应该做的事情,但是我一般都不知道phpmyadmin或不是数据库管理员,所以我只是在猜测。

remove和之间的区别在于,purgeremove仅删除程序及其数据文件(您可以重新下载的内容),而purge首先执行的remove操作随后又删除了配置文件(您可能在本地编辑的内容)。如果remove失败,也会purge


我最近尝试了您关于重新安装dbconfig-common的建议,但无济于事。我已经用这项努力的结果更新了我的问题。

@肯:尝试dpkg -i /var/cache/apt/archives/{dbconfig-common,php5-mcrypt,libjs-mootools}*.deb。如果您的缓存中没有Deb,请从packages.debian.org下载它们。如果有错误消息,请将它们张贴出来,我(或其他人)可能会帮助您解决这些问题。
吉尔(Gilles)“所以,别再邪恶了”,

尝试无济于事。似乎在干净的Debian服务器上已经释放出大量蝗虫。问题已更新,以反映此最新尝试。

@Ken:您还需要安装的依赖项php5-mcrypt。才能为您完成这项工作;您可以尝试,但我认为在您php5myadmin进入良好状态之前,它不会拒绝让步。dpkg级别较低,甚至可以在部分损坏的软件包数据库上运行。
吉尔(Gilles)“所以,别再邪恶了”,

在尝试安装时php5-mcrypt,它首先提示您删除phpmyadmindbconfig-common。我没有其他解决方案,所以我认为当我同意时,它会落在脸上。相反,简单地“建议”安装php5-mycrypt的行为允许有能力正确清理钩子并删除phpmyadmindbconfig-common。从那以后我就重新安装了它们phpmyadmin(尽管通过tar获得更多控制权)。看来最新版本不需要mysql进行自组织。感谢Giles从我的服务器上移除蝗虫!

3

有时,程序包管理系统是如此糟糕(通常是在循环依赖链中),以至于我发现删除有问题的程序包的唯一命令组合是:

  • cd /var/lib/dpkg/info ; rm <packagename.*>
  • dpkg --purge --force-remove-reinstreq <packagename>
  • 要么 dpkg --remove --force-remove-reinstreq <packagename>
  • 然后apt-get install <packagename>重新安装软件包

有时,可能还需要修复状态覆盖文件,并且上面的过程可能会引发与此有关的错误..如何修复状态覆盖文件取决于它是否是标记用户的错误。

通常:

  • 状态覆盖文件位于: /var/lib/dpkg/statoverride
  • 您可以通过运行以下命令进行更新: dpkg-statoverride --remove <stateoverride-filename>
  • 如果您知道自己在做什么,甚至可以手动编辑它们

2

(我假设您的意思是aptitude purgeapt-get remove,因为您引用的命令不存在)

尝试dpkg --purge phpmyadmin。其他工具的级别较低,因此在这种情况下可能更有效。


它提供了相同的结果,但没有能力要求的详细反馈。感谢您抓住我的命令名称。

我遇到了同样的问题,但是不幸的是,我已经手动编译了PHP,Apache等,因此,通过添加php5-mcrypt模块(具有我提到的所有依赖项)来安装它们会导致混乱和不必要的重复。有没有其他办法?
2013年

0

您可能需要运行'apt-get -f install'来更正这些:

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).

我正面临以上问题,使用“ sudo dpkg --purge postgresql-9.1”命令问题已解决

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.