我的 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)
Run Code Online (Sandbox Code Playgroud)
有两个(可能有关联?)问题困扰着我:
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
Run Code Online (Sandbox Code Playgroud)
我已经花了很多时间寻找可能的解决方案,并尝试了这里和那里建议的以下命令,其中包括
sudo dpkg --configure -a
sudo apt-get clean
sudo apt-get dist-upgrade
Run Code Online (Sandbox Code Playgroud)
但一切都是徒劳的。任何调试帮助将不胜感激!
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.
Run Code Online (Sandbox Code Playgroud)
的输出dpkg --get-selections
:
1)hold
(什么都不给)
stan@stan-ThinkPad-T530:~$ sudo dpkg --get-selections | grep hold
Run Code Online (Sandbox Code Playgroud)
2) purge
stan@stan-ThinkPad-T530:~$ sudo dpkg --get-selections|grep purge
rsyslog purge
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
其余的有状态installed
。
小智 6
我也遇到了这个问题,最后使用 Bachstelze 从这个线程的答案解决了它 - http://ubuntuforums.org/showthread.php?t=1556880 - 但只用清除 fontconfig-config 包重新安装。
这是对我有用的命令:
sudo apt-get install --reinstall --purge fontconfig-config
Run Code Online (Sandbox Code Playgroud)
嘿,只是去掉丢失的符号,你可以尝试一下:
sudo apt-get upgrade libfontconfig1
sudo apt-get install --reinstall libfontconfig1 libfontconfig1-dev libfontconfig1-dbg
Run Code Online (Sandbox Code Playgroud)