Ubuntu重新安装后,由于fontconfig更新失败

我的Ubuntu的图形输出坏了,我不得不重新安装它。 为了保留我的数据和设置,我只是通过旧系统从CD重新安装它。 除了每次更新都出错之外,一切都很顺利:

stan@stan-ThinkPad-T530:/var/lib/dpkg/info$ sudo apt-get autoremove Reading package lists... Done Building dependency tree Reading state information... Done 0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up fontconfig (2.11.1-0ubuntu6) ... Regenerating fonts cache... failed. See /var/log/fontconfig.log for more information. dpkg: error processing package fontconfig (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: fontconfig E: Sub-process /usr/bin/dpkg returned an error code (1) 

有两个(可能是链接的?)问题困扰着我:

  1. 1 not fully installed or removed. 在第6行。 它没有告诉我哪个包没有完全安装或删除,我也不知道如何找到它。

  2. 最后一行中由fontconfig引起的错误。 我在每次更新后都收到此错误,因为每次都会运行fontconfig

cat /var/log/fontconfig.log给出了以下内容:

 /usr/share/fonts: caching, new cache contents: 0 fonts, 4 dirs ... a lot of lines with various fonts ... /usr/share/fonts/type1/gsfonts: caching, new cache contents: 35 fonts, 0 dirs /usr/share/fonts/type1/mathml: caching, new cache contents: 1 fonts, 0 dirs /usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs /.local/share/fonts: skipping, no such directory Re-scanning /usr/share/fonts: fc-cache: symbol lookup error: fc-cache: undefined symbol: FcDirCacheRescan 

我已经花了很多时间寻找可能的解决方案,并尝试了以下建议,以及其中的建议

 sudo dpkg --configure -a sudo apt-get clean sudo apt-get dist-upgrade 

但一切都是徒劳的。 任何调试帮助将非常感谢!


编辑:

Shutupshare建议做apt-get install --reinstall libfontconfig1 libfontconfig1-dev libfontconfig1-dbg ,这给出了以下内容:

 stan@stan-ThinkPad-T530:~$ sudo apt-get install --reinstall libfontconfig1 libfontconfig1-dev libfontconfig1-dbg Reading package lists... Done Building dependency tree Reading state information... Done Reinstallation of libfontconfig1 is not possible, it cannot be downloaded. Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies. libfontconfig1-dbg : Depends: libfontconfig1 (= 2.11.0-0ubuntu4) but 2.11.0-0ubuntu4.1 is to be installed libfontconfig1-dev : Depends: libfontconfig1 (= 2.11.0-0ubuntu4) but 2.11.0-0ubuntu4.1 is to be installed Depends: libfreetype6-dev (>= 2.1.7) but it is not going to be installed E: Unable to correct problems, you have held broken packages. 

EDIT2:

输出dpkg --get-selections

1) hold (什么都不给)

 stan@stan-ThinkPad-T530:~$ sudo dpkg --get-selections | grep hold 

2) purge

 stan@stan-ThinkPad-T530:~$ sudo dpkg --get-selections|grep purge rsyslog purge 

3) deinstall

 stan@stan-ThinkPad-T530:~$ sudo dpkg --get-selections|grep deinstall libcap2:i386 deinstall libcgmanager0:i386 deinstall libepoxy0 deinstall libffi6:i386 deinstall libglib2.0-0:i386 deinstall libllvm3.5:amd64 deinstall libpython2.7-minimal:i386 deinstall libsystemd-daemon0:i386 deinstall libudev1:i386 deinstall 

其余的已installed状态。

我也有这个问题,最后使用Bachstelze从这个post回答来解决它 – http://ubuntuforums.org/showthread.php?t=1556880 – 但只能用purge fontconfig-config软件包重新安装。

这是对我有用的命令:

 sudo apt-get install --reinstall --purge fontconfig-config 

看来你在这里遇到的主要问题是fontconfig-config的版本是2.11.0-0ubuntu4.1版本,但安装libfontconfig1-dev需要2.11.0-0ubuntu4。 希望你已经解决了这个问题。 如果没有,您可以尝试将fontconfig-config降级为2.11.0-0ubuntu4。

 sudo apt-get install fontconfig-config=2.11.0-0ubuntu4 

然后,至少你可以安装libfontconfig1-dev以及libfontfig1 = 2.11.0-0ubuntu4。

嘿,你可以尝试一下这个缺失的符号:

 sudo apt-get upgrade libfontconfig1 sudo apt-get install --reinstall libfontconfig1 libfontconfig1-dev libfontconfig1-dbg 

这是对我有用的命令: https : //launchpad.net/ubuntu/trusty/amd64/libfontconfig1-dev/2.11.0-0ubuntu4.1

 wget http://launchpadlibrarian.net/177041650/libfontconfig1-dev_2.11.0-0ubuntu4.1_amd64.deb sudo apt-get install libexpat1-dev sudo dpkg -i libfontconfig1-dev_2.11.0-0ubuntu4.1_amd64.deb