处理时遇到错误:install-info

处理时遇到错误:install-info
$ sudo apt-get install wondershaper python-qt4 arp-scan dsniff arptables

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-qt4 is already the newest version (4.11.4+dfsg-1build4).
The following additional packages will be installed:
  libnet1 libnids1.21
The following NEW packages will be installed
  arp-scan arptables dsniff libnet1 libnids1.21 wondershaper
0 to upgrade, 6 to newly install, 0 to remove and 6 not to upgrade.
1 not fully installed or removed.
Need to get 0 B/419 kB of archives.
After this operation, 1,468 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up install-info (6.1.0.dfsg.1-5) ...
/usr/sbin/update-info-dir: 5: /etc/environment: Syntax error: Unterminated quoted string
dpkg: error processing package install-info (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

/etc/default/locale我遇到了同样的问题,我的解决方案是从中删除 quote-sign in :

LC_TIME=""en_US.UTF-8"

对此

LC_TIME="en_US.UTF-8"

答案2

将以下内容复制到文件中并将其保存为桌面askubuntu

#!/bin/sh
# update-info-dir
# create a dir file from all installed info files
# Copyright 2009, 2014 Norbert Preining
# GPLv2

INFODIR=/usr/share/info

set -e

#
# since user's environment is taken over into root account when sudo-ing
# we don't want that one's user LANGUAGE setting changes the messages in
# the dir file. Unset LANGUAGE and reload /etc/environment to get
# the system wide settings. See bug #536476
unset LANGUAGE
unset LANG
if [ -r /etc/environment ] ; then
  . /etc/environment
fi
if [ -r /etc/default/locale ] ; then
  . /etc/default/locale
fi

Help ()
{
    echo "\
SYNOPSIS: update-info-dir [-h,--help] [info-directory]

(re-)creates the index of available documentation in info format
(the file /usr/share/info/dir) which is usually presented by info browsers
on startup."

    exit 0
}


if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
    Help
fi

if [ -n "$1" ] ; then
  INFODIR="$1"
fi

if [ ! -d "$INFODIR" ] ; then
  echo "Not a directory: $INFODIR." >&2
  exit 1
fi

if [ -r "$INFODIR/dir" ] ; then
  rm -f "$INFODIR/dir.old"
  cp $INFODIR/dir $INFODIR/dir.old
fi

# we have to remove the dir file not make install-info being surprised
rm -f "$INFODIR/dir"

errors=0
find "$INFODIR" -type f | while read file ; do
  case $file in
    */dir|*/dir.gz|*/dir.old|*/dir.old.gz|*-[0-9]|*-[0-9].gz|*-[1-9][0-9]|*-[1-9][0-9].gz|*.png|*.jpg)
      # these files are ignored
      continue
      ;;
    *)
      install-info "$file" "$INFODIR/dir" || {
        errors=$((errors+1))
      }
      ;;
  esac
done

if [ $errors -gt 0 ] ; then
  exec >&2
  echo
  echo "Updating the index of info documentation produced $errors errors."
fi

exit 0

# vim:set expandtab tabstop=2: #
  • 打开终端并运行:

    • sudo cp /usr/sbin/update-info-dir /usr/sbin/update-info-dir-backup
    • sudo rm /usr/sbin/update-info-dir
    • sudo cat ~/Desktop/askubuntu | sudo tee /usr/sbin/update-info-dir
    • sudo chmod +x /usr/sbin/update-info-dir

相关内容