Why this dpkg error: ambiguous package name 'libglib2.0-0' ...?

I have some weird errors while trying to install packages with software center or even when I try to upgrade packages with sudo apt-get install upgrade:

dpkg: error: file triggers record mentions illegal package name `libglib2.0-0' (for interest in file `/usr/lib/x86_64-linux-gnu/gio/modules'): ambiguous package name 'libglib2.0-0' with more than one installed instance

Previously I had error:

dpkg: error: configuration error: /etc/dpkg/dpkg.cfg.d/multiarch:1: unknown option 'foreign-architecture'

but I have just removed it with: sudo rm /etc/dpkg/dpkg.cfg.d/multiarch, I guess this post describes this issue - I have followed it, but the last part sudo apt-get install dpkg=1.16.0.3ubuntu5 did not work for me - no such package could be found. Probably it is because I am using ubuntu 12.04.

UPDATE: adter trying to installcorrect version of dpkg 1.16.1.2ubuntu7 as suggested in the answer, I now get following errors:

$ sudo apt-get install dpkg=1.16.1.2ubuntu7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 ia32-libs : Depends: ia32-libs-multiarch but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

By the way, this might be also helpful:

$ sudo dpkg --configure -a 
dpkg: error: file triggers record mentions illegal package name `libglib2.0-0' (for interest in file `/usr/lib/x86_64-linux-gnu/gio/modules'): ambiguous package name 'libglib2.0-0' with more than one installed instance

which is actually telling the same thing.

UPDATE: content of (...) modules:

/usr/lib/x86_64-linux-gnu/gio/modules$ ls
giomodule.cache      libgiognutls.so                 libgvfsdbus.so
libdconfsettings.so  libgiolibproxy.so
libgiognomeproxy.so  libgioremote-volume-monitor.so

UPDATE: /var/lib/dpkg/triggers/File

$ sudo grep libglib /var/lib/dpkg/triggers/File 
/usr/lib/x86_64-linux-gnu/gio/modules libglib2.0-0
/usr/lib/gio/modules libglib2.0-0
/usr/share/glib-2.0/schemas libglib2.0-0
/usr/lib/i386-linux-gnu/gio/modules libglib2.0-0:i386
/usr/lib/gio/modules libglib2.0-0:i386
/usr/share/glib-2.0/schemas libglib2.0-0:i386

no such package could be found. Probably it is because I am using ubuntu 12.04.

The corresponding version for Ubuntu 12.04, as of this date, should be 1.16.1.2ubuntu7.

ia32-libs : Depends: ia32-libs-multiarch but it is not installable

This is a link to the ia32-libs-multiarch page, where you can download the .deb file. Please use dpkg -i filename.deb to manually install it, and if successful, try apt-get again. If not, please update with dpkg error.


I installed ia32 on a test x86_64 system, and got the following for the contents of the triggers File and the contents of giomodule.cache. Please check to see how yours differ:

izx@myprecise:~$ grep libglib /var/lib/dpkg/triggers/File 
/usr/lib/x86_64-linux-gnu/gio/modules libglib2.0-0
/usr/lib/gio/modules libglib2.0-0
/usr/share/glib-2.0/schemas libglib2.0-0
/usr/lib/i386-linux-gnu/gio/modules libglib2.0-0:i386
/usr/lib/gio/modules libglib2.0-0:i386
/usr/share/glib-2.0/schemas libglib2.0-0:i386

izx@myprecise:~$ ls /usr/lib/x86_64-linux-gnu/gio/modules
giomodule.cache      libgiognutls.so                 libgvfsdbus.so
libdconfsettings.so  libgiolibproxy.so
libgiognomeproxy.so  libgioremote-volume-monitor.so

izx@myprecise:~$ cat /usr/lib/x86_64-linux-gnu/gio/modules/giomodule.cache 
libgiognutls.so: gio-tls-backend
libgioremote-volume-monitor.so: gio-native-volume-monitor,gio-volume-monitor
libgvfsdbus.so: gio-vfs,gio-volume-monitor
libgiolibproxy.so: gio-proxy-resolver
libdconfsettings.so: gsettings-backend
libgiognomeproxy.so: gio-proxy-resolver

I had the exact same issues.

I removed the line

/usr/lib/gio/modules libglib2.0-0

from /var/lib/dpkg/triggers/File

Although being a bit of a novice, I'm not sure it was a good idea or not, but it at least removed the error so I could continue.