2

[Reposted from askubuntu.com]

I can't install any software. I think this dates from an unexpected power loss a few days ago.

When I try sudo apt-get install gparted I see

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)

This is after trying several fixes, I have eliminated other errors which were occuring previously but I did not record them.

I have tried the procedure in https://askubuntu.com/questions/134842/dpkg-error-duplicate-file-trigger-interest-for-filename-usr-lib-gio-modules but I don't know how to use sed (nor, really, what it is). The command suggested there is

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

When I paste that block into the terminal, or run it as a separate script, I get no feedback; the terminal sends me straight back to the prompt instantly, and when I try again to install gparted, I get exactly the same messages as mentioned.

I have tried to look directly at /usr/lib/gio/modules but I can't see /usr/lib/gio; it appears to not exist!

I'm running Linux Mint 17.2 64-bit, uname -r gives 3.16.0-38-generic

3

It is a well-known problem, probably a dpkg or some installscript bug.

/var/lib/dpkg/triggers/File contain a list of files and triggers (in the installscript) to use with.

This file should be a simple text file, without any duplicated entries. Edit it with a text editor, and check. If there are duplicates, fix them (make a backup from this before that).

  • Perfect, thanks! I used Libreoffice Calc (yeah I know) to parse /var/lib/dpkg/triggers/File and found four duplicates. Deleted those, ran apt-get update, apt-get upgrade and apt-get dist-upgrade, and installed gparted. Didn't even need to reboot (or close Kerbal Space Program, for that matter). – cosmogoblin Sep 12 '15 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.