我有点苦恼。我试图升级一个 chroot 的环境,似乎我在这个过程中破坏了 dpkg。
我不知道问题的原因是 apt-get 无法处理 qmail 升级还是其他原因(似乎 snmpd 在上一轮也没有“完成”)。
我认为我要解决的错误是:
E: Sub-process /usr/bin/dpkg returned an error code (1)
看来我有一个非常旧的 qmail 版本,升级到我的 apt 镜像中的那个改变太大了。我用谷歌搜索过,还没有找到 1.03-38 和 1.06-5 之间的任何东西。
(删除了几行并在格式上苦苦挣扎)
# apt-get install qmail
The following extra packages will be installed:
qmail-run qmail-uids-gids
Suggested packages:
dot-forward qmail-tools
The following NEW packages will be installed:
qmail-run qmail-uids-gids
The following packages will be upgraded:
qmail
1 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
107 not fully installed or removed.
Do you want to continue [Y/n]?
Get:1 http://10.105.176.67/debian/ wheezy/main snmpd i386 5.4.3~dfsg-2.8+deb7u1 [964 kB]
Fetched 964 kB in 0s (6,685 kB/s)
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 1852018 files and directories currently installed.)
Preparing to replace qmail 1.03-38 (using .../archives/qmail_1.06-5_i386.deb) ...
Upgrading from qmail version 1.03-38 is not yet supported.
dpkg: error processing /var/cache/apt/archives/qmail_1.06-5_i386.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
rmdir: failed to remove `/var/lib/qmail': Directory not empty
insserv: warning: script 'K01qmail' missing LSB tags and overrides
insserv: warning: script 'qmail' missing LSB tags and overrides
dpkg: regarding .../qmail-uids-gids_1.06-5_all.deb containing qmail-uids-gids:
qmail conflicts with qmail-uids-gids
qmail-uids-gids (version 1.06-5) is to be installed.
dpkg: error processing /var/cache/apt/archives/qmail-uids-gids_1.06-5_all.deb (--unpack):
conflicting packages - not installing qmail-uids-gids
dpkg: regarding .../qmail-run_2.0.2_all.deb containing qmail-run:
qmail-run conflicts with mail-transport-agent
qmail provides mail-transport-agent and is present and installed.
dpkg: error processing /var/cache/apt/archives/qmail-run_2.0.2_all.deb (--unpack):
conflicting packages - not installing qmail-run
Errors were encountered while processing:
/var/cache/apt/archives/qmail_1.06-5_i386.deb
/var/cache/apt/archives/qmail-uids-gids_1.06-5_all.deb
/var/cache/apt/archives/qmail-run_2.0.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我刚刚跑了这个:
至少这让我克服了 dpkg 的这个问题/错误。我迫切需要安装一个自定义的 deb 包。
在尝试安装我的自定义 deb 包时,我收到了很多这样的消息:
我猜我的最后一批补丁不知何故以错误结束,dpkg 不会让我做任何其他事情。
我的 qmail(可能还有 snmpd)问题仍然存在,但我现在只需要“修复”dpkg。