$ sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
sudo: unable to resolve host lhc-rd
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
liblzma-dev is already the newest version (5.1.1alpha+20120614-2ubuntu2).
patch is already the newest version (2.7.5-1).
ruby-dev is already the newest version (1:2.3.0+1).
zlib1g-dev is already the newest version (1:1.2.8.dfsg-2ubuntu4.1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
4 not fully installed or removed.
Need to get 0 B/21.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "zh_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
dpkg: error processing package libgvc6-plugins-gtk (--configure):
package libgvc6-plugins-gtk is not ready for configuration
cannot configure (current status 'half-installed')
dpkg: dependency problems prevent configuration of libgraphviz-dev:
libgraphviz-dev depends on libgvc6-plugins-gtk (= 2.38.0-12ubuntu2.1); however:
Package libgvc6-plugins-gtk is not installed.
dpkg: error processing package libgraphviz-dev (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of libmagickcore-6.q16-dev:amd64:
libmagickcore-6.q16-dev:amd64 depends on libgraphviz-dev; however:
Package libgraphviz-dev is not configured yet.
dpkg: error processing package libmagickcore-6.q16-dev:amd64 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of libmagickwand-6.q16-dev:amd64:
libmagickwand-6.q16-dev:amd64 depends on libmagickcore-6.q16-dev (= 8:6.8.9.9-7ubuntu5.9); however:
Package libmagickcore-6.q16-dev:amd64 is not configured yet.
dpkg: error processing package libmagickwand-6.q16-dev:amd64 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
libgvc6-plugins-gtk
libgraphviz-dev
libmagickcore-6.q16-dev:amd64
libmagickwand-6.q16-dev:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
ps: 改过 /var/lib/dpkg/info目录,没用,如下:
#先备份原来的,然后重新新建
sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bak //现将info文件夹更名
sudo mkdir /var/lib/dpkg/info //再新建一个新的info文件夹
sudo apt-get update
#不用解释了吧,修复安装
apt-get -f install xxx
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info.bak
#执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info.bak文件夹下
sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉
sudo mv /var/lib/dpkg/info.bak /var/lib/dpkg/info //把以前的info文件夹重新改回名字