Ubuntu – dpkg: error: duplicate file trigger interest for filename `/usr/share/icons/hicolor’ and package `hicolor-icon-theme’

aptdpkgpackage-management

I can't install or remove any packages right now. Every aptitude or dpkg command fails with

dpkg: error: duplicate file trigger interest for filename
`/usr/share/icons/hicolor' and package `hicolor-icon-theme'

I tried the sed trick from dpkg: error: duplicate file trigger interest for filename `/usr/lib/gio/modules' and package `libglib2.0-0:i386', but that didn't work for me.

I'm running 12.10 with 3.2.0-32.

Edit 1:

ls -al /usr/share/icons/hicolor`
  total 92
  drwxr-xr-x 15 root root  4096 Jun 19 18:56 .
  drwxr-xr-x  3 root root  4096 Mar 24 23:11 ..
  drwxr-xr-x 15 root root  4096 Apr  1  2009 128x128
  drwxr-xr-x 15 root root  4096 Apr  1  2009 16x16
  drwxr-xr-x 15 root root  4096 Apr  1  2009 192x192
  drwxr-xr-x 15 root root  4096 Apr  1  2009 22x22
  drwxr-xr-x 15 root root  4096 Apr  1  2009 24x24
  drwxr-xr-x 15 root root  4096 May  4  2011 256x256
  drwxr-xr-x 15 root root  4096 Apr  1  2009 32x32
  drwxr-xr-x 15 root root  4096 Apr  1  2009 36x36
  drwxr-xr-x 15 root root  4096 Apr  1  2009 48x48
  drwxr-xr-x 15 root root  4096 Apr  1  2009 64x64
  drwxr-xr-x 15 root root  4096 Apr  1  2009 72x72
  drwxr-xr-x 15 root root  4096 Apr  1  2009 96x96
  -rw-r--r--  1 root root  1252 Nov  3  2012 icon-theme.cache
  -rw-r--r--  1 root root 24671 Mar 22  2012 index.theme
  drwxr-xr-x 15 root root  4096 Apr  1  2009 scalable

Edit 2:

$ cat /var/lib/dpkg/triggers/File
  /usr/share/icons/hicolor hicolor-icon-theme
  /usr/share/info install-info
  /usr/share/wordpress/wp-content wordpress
  /etc/init ureadahead
  /etc/init.d ureadahead
  /usr/man man-db
  /usr/share/man man-db
  /usr/local/man man-db
  /usr/local/share/man man-db
  /usr/X11R6/man man-db
  /opt/man man-db
  /etc/ufw/applications.d ufw
  /etc/lsb-release plymouth-theme-ubuntu-text
  /usr/lib/mime/packages mime-support
  /etc/sgml sgml-base
  /usr/share/package-data-downloads update-notifier-common
  /usr/share/fonts fontconfig
  /usr/share/ghostscript/fonts fontconfig
  /usr/share/texmf/fonts fontconfig
  /usr/lib/x86_64-linux-gnu/gio/modules libglib2.0-0:amd64
  /usr/lib/gio/modules libglib2.0-0:amd64
  /usr/share/glib-2.0/schemas libglib2.0-0:amd64
  /etc/php5/conf.d libapache2-mod-php5
  /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders libgdk-pixbuf2.0-0:amd64
  /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders libgdk-pixbuf2.0-0:amd64
  /usr/share/mime/packages shared-mime-info
  /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules libgtk2.0-0:amd64
  /usr/lib/gtk-2.0/2.10.0/immodules libgtk2.0-0:amd64
  /usr/share/icons/hicolor hicolor-icon-theme

Best Answer

Notice the first and last lines of /var/lib/dpkg/triggers/File are duplicates (both contain the same about hicolor). Try removing one of the lines (leaving the other!):

sudo gedit /var/lib/dpkg/triggers/File

then save it. Then try installing/removing software again.

You might also want to run sudo apt-get clean, since apt-get might have cached the packages that failed to install.

Related Question