我的 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 not fully installed or removed.
在第 6 行。它没有告诉我哪个包没有完全安装或删除,而且我不知道如何找出它。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.
编辑2:
输出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
。
答案1
我也遇到了这个问题,最后用这个帖子中的 Bachstelze 答案解决了它 -http://ubuntuforums.org/showthread.php?t=1556880- 但只能使用 purge fontconfig-config 包重新安装。
这是对我有用的命令:
sudo apt-get install --reinstall --purge fontconfig-config
答案2
这是对我有用的命令: 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
答案3
看来您遇到的主要问题是 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。
答案4
我必须跑:
apt-get remove libfontconfig1
其次是
apt-get install libfontconfig1-dev