解决Ubuntu的dpkg: error processing install-info问题

0 / 1187

一、服务器安装软件是出现以下的错误信息:

$ sudo apt-get install nfs-common
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.31) ...
Setting up libnfsidmap2:amd64 (0.25-5) ...
Setting up keyutils (1.5.9-8ubuntu1) ...
Setting up libtirpc1:amd64 (0.2.5-1.2ubuntu0.1) ...
Setting up rpcbind (0.2.3-0.6ubuntu0.18.04.4) ...
Installing new version of config file /etc/init.d/rpcbind ...
Setting up nfs-common (1:1.3.4-2.1ubuntu5.3) ...
dpkg: error processing package nfs-common (--configure):
subprocess installed post-installation script returned error exit status 10
Processing triggers for libc-bin (2.27-3ubuntu1.5) ...
Processing triggers for systemd (229-4ubuntu21.31) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Errors were encountered while processing:
 nfs-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

二、具体步骤

  1. 将info文件夹更名
# sudo mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/
  1. 再新建一个新的info文件夹
# sudo mkdir /var/lib/dpkg/info/
  1. 更新文件列表
# sudo apt-get update
  1. 重新安装
# sudo apt-get -f install
  1. 执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_old文件夹下
# sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/
  1. 把自己新建的info文件夹删掉
# sudo rm -rf /var/lib/dpkg/info
  1. 把info_old文件夹重新改回info
# sudo mv /var/lib/dpkg/info_old/ /var/lib/dpkg/info/
  1. 输入上述命令之后,再执行 sudo apt-get update 就不会有问题了