dpkg:错误:重复文件触发对文件名“/usr/lib/gio/modules”和包“libglib2.0-0”的兴趣

dpkg:错误:重复文件触发对文件名“/usr/lib/gio/modules”和包“libglib2.0-0”的兴趣

[转自askubuntu.com]

我无法安装任何软件。我认为这是几天前意外断电造成的。

当我尝试时sudo apt-get install gparted我看到

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpython2.7-minimal mime-support python2.7-minimal
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  busybox-initramfs cpio dmsetup fontconfig fontconfig-config
  fonts-dejavu-core initramfs-tools initramfs-tools-bin initscripts
  klibc-utils kmod libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libavahi-client3
  libavahi-common-data libavahi-common3 libcairo2 libcairomm-1.0-1
  libcgmanager0 libcups2 libdatrie1 libdbus-1-3 libdevmapper1.02.1 libexpat1
  libffi6 libfontconfig1 libfreetype6 libgcrypt11 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libglib2.0-0 libglibmm-2.4-1c2a libgnutls26
  libgpg-error0 libgraphite2-3 libgssapi-krb5-2 libgtk2.0-0 libgtk2.0-common
  libgtkmm-2.4-1c2a libharfbuzz0b libjasper1 libjbig0 libjpeg-turbo8 libjpeg8
  libk5crypto3 libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0
  libncursesw5 libnih-dbus1 libnih1 libp11-kit0 libpango-1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpangomm-1.4-1 libparted0debian1
  libpixman-1-0 libpng12-0 libprocps3 libsigc++-2.0-0c2a libtasn1-6
  libthai-data libthai0 libtiff5 libudev1 libx11-6 libx11-data libxau6
  libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1
  libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxml2 libxrandr2
  libxrender1 module-init-tools procps shared-mime-info ucf udev
Suggested packages:
  libarchive1 xfsprogs reiserfsprogs reiser4progs jfsutils ntfs-3g dosfstools
  yelp kpartx dmraid gpart bash-completion cups-common rng-tools gnutls-bin
  krb5-doc krb5-user librsvg2-common gvfs libjasper-runtime ttf-baekmuk
  ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp
  ttf-arphic-bkai00mp parted nparted libparted0-dev libparted0-i18n
Recommended packages:
  psmisc dbus libglib2.0-data hicolor-icon-theme libgtk2.0-bin krb5-locales
  libgpm2 xml-core
The following NEW packages will be installed
  busybox-initramfs cpio dmsetup fontconfig fontconfig-config
  fonts-dejavu-core gparted initramfs-tools initramfs-tools-bin initscripts
  klibc-utils kmod libatk1.0-0 libatk1.0-data libatkmm-1.6-1 libavahi-client3
  libavahi-common-data libavahi-common3 libcairo2 libcairomm-1.0-1
  libcgmanager0 libcups2 libdatrie1 libdbus-1-3 libdevmapper1.02.1 libexpat1
  libffi6 libfontconfig1 libfreetype6 libgcrypt11 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libglib2.0-0 libglibmm-2.4-1c2a libgnutls26
  libgpg-error0 libgraphite2-3 libgssapi-krb5-2 libgtk2.0-0 libgtk2.0-common
  libgtkmm-2.4-1c2a libharfbuzz0b libjasper1 libjbig0 libjpeg-turbo8 libjpeg8
  libk5crypto3 libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0
  libncursesw5 libnih-dbus1 libnih1 libp11-kit0 libpango-1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpangomm-1.4-1 libparted0debian1
  libpixman-1-0 libpng12-0 libprocps3 libsigc++-2.0-0c2a libtasn1-6
  libthai-data libthai0 libtiff5 libudev1 libx11-6 libx11-data libxau6
  libxcb-render0 libxcb-shm0 libxcb1 libxcomposite1 libxcursor1 libxdamage1
  libxdmcp6 libxext6 libxfixes3 libxi6 libxinerama1 libxml2 libxrandr2
  libxrender1 module-init-tools procps shared-mime-info ucf udev
0 to upgrade, 92 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
Need to get 0 B/14.2 MB of archives.
After this operation, 59.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Extract templates from packages: 100%
Preconfiguring packages ...
dpkg: error: duplicate file trigger interest for filename `/usr/lib/gio/modules' and package `libglib2.0-0'
E: Sub-process /usr/bin/dpkg returned an error code (2)

这是在尝试了几次修复之后,我消除了之前发生的其他错误,但我没有记录它们。

我已经尝试过该程序https://askubuntu.com/questions/134842/dpkg-error-duplicate-file-trigger-interest-for-filename-usr-lib-gio-modules但我不知道如何使用sed(也不知道它是什么)。建议的命令是

sed -n -e"s,/,\\\\\\\\/,g; s/:$(dpkg --print-architecture)$//p " \
      /var/lib/dpkg/triggers/File \
| while read line; do
     sudo sed -i -e"/^$line$/d" /var/lib/dpkg/triggers/File
done

当我将该块粘贴到终端中或将其作为单独的脚本运行时,我没有得到任何反馈;终端立即将我直接发送回提示符,当我再次尝试安装 gparted 时,我收到与上述完全相同的消息。

我试图直视,/usr/lib/gio/modules但我看不到/usr/lib/gio;它似乎不存在!

我正在跑步Linux Mint 17.2 64-bituname -r3.16.0-38-generic

答案1

这是一个众所周知的问题,可能是一个dpkg或一些安装脚本错误。

/var/lib/dpkg/triggers/File包含要使用的文件和触发器列表(在安装脚本中)。

该文件应该是一个简单的文本文件,没有任何重复的条目。用文本编辑器编辑它,然后检查。如果存在重复项,请修复它们(在此之前进行备份)。

相关内容