0

I mistakenly dpkg-ed libfontconfig1 on Ubuntu 16.04 by running following command:

sudo dpkg -i ~/Downloads/libfontconfig1_2.12.3-0.2_amd64.deb

And now it conflicts with previously installed libfontconfig1. Following the list:

$sudo dpkg --list libfontconfig1
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)

||/ Name                 Version            Architecture Description
+++-====================-==================-============-============================================
rU  libfontconfig1:amd64 2.12.3-0.2         amd64        generic font configuration library - runtime
iF  libfontconfig1:i386  2.11.94-0ubuntu1.1 i386         generic font configuration library - runtime

And I'm not able to remove it because seems it's a major package and is a dependency for many other packages: all of them require a version (which is lower than 2.12.3-0.2) or greater version. And seems because of or greater condition, the version 2.12.3-0.2 is being blocked for removal, even though I have other version installed. When I run

sudo apt-get purge  libfontconfig1:amd64

It doesn't allow me, because many things depends on lower or equal version of the package:

firefox : Depends: libfontconfig1 (>= 2.11.94) but it is not going to be installed
libbluray1 : Depends: libfontconfig1 (>= 2.9.0) but it is not going to be installed
libcairo2 : Depends: libfontconfig1 (>= 2.9.0) but it is not going to be installed
...

Removing through dpkg also not helpful:

$sudo dpkg --remove libfontconfig1:amd64
libqtwebkit4:amd64 depends on libfontconfig1 (>= 2.9.0).
openjdk-8-jre-headless:amd64 depends on libfontconfig1.
libclutter-1.0-0:amd64 depends on libfontconfig1 (>= 2.9.0).
fontconfig depends on libfontconfig1 (>= 2.11.94).
...
dpkg: error processing package libfontconfig1:amd64 (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 libfontconfig1:amd64

When I run sudo apt-get -f install I get following result:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
libfontconfig1: Depends: fontconfig-config (>= 2.12.3-0.2) but 2.11.94-0ubuntu1.1 is installed
                Breaks: libfontconfig1:i386 (!= 2.12.3-0.2) but 2.11.94-0ubuntu1.1 is installed
libfontconfig1:i386 : Breaks: libfontconfig1 (!= 2.11.94-0ubuntu1.1) but 2.12.3-0.2 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

So, how do I remove a particular version of libfontconfig1 package?

Appreciate any help.

Vic K
  • 161
  • dpkg has an --ignore-depends option. Have you tried that? – muru Sep 08 '17 at 02:09
  • @muru thanks for the response! this option requires to list all the deps which is more than 80.. I'm trying to find a way to ignore all, but so far no luck – Vic K Sep 08 '17 at 03:29

1 Answers1

1

The problem is solved by removing a libfontconfig1:amd64 section in /var/lib/dpkg/status. Then I ran sudo apt-get -f install (had to remove /usr/share/doc/libfontconfig1/ directory). The idea is described here.

Also, the original goal was to install openjdk-7-jdk (this is why I had to dpkg libfontconfig1), answer was helpful.

Vic K
  • 161