无法安装软件包ttf-mscorefonts-installer

这些是终端上显示的问题:

W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/andale32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/arial32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) 

类似地,许多其他文件与ttf-mscorefonts-installer相关。

解决问题的是手动安装(@ rag2):

 wget http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb sudo dpkg -i ttf-mscorefonts-installer_3.6_all.deb 

详细信息: https : //gist.github.com/melvincabatuan/26f3ac4ace4be3a8b48d85a1b3250982

不幸的是, 以下答案对我不起作用(在Ubuntu 16.04中)。

 sudo rm -rf /var/lib/update-notifier/package-data-downloads/partial/* sudo apt-get --purge --reinstall install ttf-mscorefonts-installer 

结果:

 Reading package lists... Done Building dependency tree Reading state information... Done The following package was automatically installed and is no longer required: ubuntu-core-launcher Use 'sudo apt autoremove' to remove it. 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 34 not upgraded. Need to get 0 B/29.5 kB of archives. After this operation, 0 B of additional disk space will be used. Preconfiguring packages ... (Reading database ... 286132 files and directories currently installed.) Preparing to unpack .../ttf-mscorefonts-installer_3.4+nmu1ubuntu2_all.deb ... mscorefonts-eula license has already been accepted Unpacking ttf-mscorefonts-installer (3.4+nmu1ubuntu2) over (3.4+nmu1ubuntu2) ... Processing triggers for fontconfig (2.11.94-0ubuntu1.1) ... Processing triggers for update-notifier-common (3.168.3) ... ttf-mscorefonts-installer: processing... ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/andale32.exe Get:1 http://downloads.sourceforge.net/corefonts/andale32.exe [361 B] Err:1 http://downloads.sourceforge.net/corefonts/andale32.exe 404 Not Found W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/andale32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) E: Failed to fetch https://ncu.dl.sourceforge.net/project/corefonts/the fonts/final/andale32.exe 404 Not Found E: Download Failed Setting up ttf-mscorefonts-installer (3.4+nmu1ubuntu2) ... 

ttf-mscorefonts-installer的版本3.4目前已损坏。 Debian存储库中的3.6版工作正常。 您可以相应地下载并安装软件包(从而修复上述错误):

 wget http://ftp.us.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb sudo dpkg -i ttf-mscorefonts-installer_3.6_all.deb 

备选的区域存储库位于https://packages.debian.org/sid/all/ttf-mscorefonts-installer/download 。

这为我修复了上述错误。

这是启动板上的错误报告 。 该错误的原因是sourceforge.org上的http重定向,安装程序无法正确处理。

该报告的作者提供了两个具有详细演练的变通方法:

  • 一个是从其他答案中提到的debian网站上发布v3.6。
  • 另一种是使用wget手动从sourceforge下载所需的文件,它可以很好地处理重定向,然后运行dpkg-reconfigure并在询问时指定包含下载文件的目录。

创建一个临时目录并下载字体:

 mkdir /tmp/mscoref cd /tmp/mscoref wget http://downloads.sourceforge.net/corefonts/{andale32.exe,arial32.exe,arialb32.exe,comic32.exe,courie32.exe,georgi32.exe,impact32.exe,times32.exe,trebuc32.exe,verdan32.exe,webdin32.exe} 

然后清除失败的包

 sudo apt-get purge ttf-mscorefonts-installer 

重新安装包忽略可能的错误:

 sudo apt-get install ttf-mscorefonts-installer 

最后:

 sudo dpkg-reconfigure ttf-mscorefonts-installer 

这将导致此消息:

在此处输入图像描述

enter ; 在框中键入下载文件的路径(注意: .在这里对我不起作用):

在此处输入图像描述

然后再次按enter键。

现在字体顺利安装:

 .... Extracting cabinet: /tmp/mscoref/webdin32.exe extracting fontinst.exe extracting Webdings.TTF extracting fontinst.inf extracting Licen.TXT All done, no errors. All fonts downloaded and installed. 

所有的积分应该从启动板到robingape

有趣的是,这个bug是apt而不是dpkgwget的bug。 您可以通过下载16.04(xenial)来避免这种情况

http://packages.ubuntu.com/xenial/all/ttf-mscorefonts-installer/download

并手动安装:

 ubuntu@green: $ cd Downloads ubuntu@green:~/Downloads $ dpkg --install ttf-mscorefonts-installer_3.6_all.deb 

使用此命令修复问题:

 sudo rm -rf /var/lib/update-notifier/package-data-downloads/partial/* sudo apt-get --purge --reinstall install ttf-mscorefonts-installer\ 

在这里查看其他解决方案: 如何在安装后输入ttf-mscorefonts-installer软件包下载字体?