Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
    
Would you include a link to the contents of /var/lib/dpkg/triggers/File? (Assuming the problem is related to this file.) –  edwin Jul 5 '13 at 23:43
    
I have kind of replicated the error: a) I duplicated the hicolor line in /var/lib/dpkg/triggers/File, b) I tried installing something that might update hicolor (sudo apt-get install xpdf), and c) the package gets downloaded but when the installation starts there's the error and on the last line: E: Sub-process /usr/bin/dpkg returned an error code (2). –  edwin Jul 6 '13 at 0:06
    
edwin: question updated with the contents of the file. –  Paul Schreiber Jul 6 '13 at 13:01
    
Ubuntu Software Center > Edit > Software sources... > Other software tab > Is there any line related to "hicolor-icon-theme"? –  mini Jul 10 '13 at 10:40
    
The first and last lines of /var/lib/dpkg/triggers/File are duplicates, remove one. That should fix the problem. –  edwin Jul 10 '13 at 23:12

3 Answers 3

up vote 4 down vote accepted
+50

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.

share|improve this answer

You could try it with re-set the file-attributes by :

chmod 755 /usr/share/icons/hicolor && chmod 755 /usr/share/icons/hicolor/*

Then reboot your machine and check if this helped or if problems stay the same.

If problem stay the same then :

apt-get install --reinstall dpkg*

then :

dpkg --purge hicolor-icon-theme

after that install it again :

dpkg -i hicolor-icon-theme

Yes, I know, this looks trivial, but often it is only a read-write-error of installed packages resp. a matter of file-attributes.

share|improve this answer
    
chmod didn't help. The apt-get install --reinstall command fails with the same dpkg error. –  Paul Schreiber Jul 5 '13 at 21:03
1  
goto sudo gedit /var/lib/dpkg/triggers/File ":" Delete all occurrences and save the file, then run sudo apt-get update. –  j0h Jul 6 '13 at 6:04
    
j0h — that worked. Can you make a real answer so I can accept it? –  Paul Schreiber Jul 6 '13 at 13:06

Here is presented a little solution for similiar situation (it comes from debian-list) :

http://useranswer.com/answer/dpkg-error-duplicate-file-trigger-interest-for-filename-usrlibgiomodules-and-package-libglib2-0-0i386/

Maybe this helps already ?

There this "duplicate - error" is solved by:

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

share|improve this answer
    
That's the exact same technique I already stated didn't work. Please click the link in my question. –  Paul Schreiber Jul 5 '13 at 4:10
    
what output has ls -al /usr/share/icons/hicolor ? –  dschinn1001 Jul 5 '13 at 13:02
    
See pastebin.com/ukueCurN –  Paul Schreiber Jul 5 '13 at 17:30
    
@PaulSchreiber Don't quite know, if this is a matter of file-attribute ?! try this: chmod 755 /usr/share/icons/hicolor and chmod 755 /usr/share/icons/hicolor/* ( after this reboot your machine and check if problems stay the same ) - otherwise this would then go deeper. If no success I will look at it tommorrow again. Now bed-time for me. –  dschinn1001 Jul 5 '13 at 17:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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