安装ttf-mscorefonts-installer时出现权限错误/由于用户'_apt'无法访问文件而无法删除特权


45

我想在16.04上安装Microsoft字体并运行下面的命令,但是关于用户_apt没有下载.exe文件的权限,有很多错误(或只有警告?)。

命令:

sudo apt install ttf-mscorefont-installer

错误消息(每个下载的字体exe都重复出现):

ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/andale32.exe
Get:1 http://downloads.sourceforge.net/corefonts/andale32.exe [198 kB]
Fetched 198 kB in 1s (180 kB/s)                                                              
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)

但是最后仍然说安装成功。那么,这仅仅是软件包安装脚本中的错误,还是我这边有什么问题?我是否需要采取进一步措施?

完整输出(原始输出与相同--reinstall):

$ sudo apt install --reinstall ttf-mscorefonts-installer 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 4 not to upgrade.
Need to get 29,5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ftp.uni-stuttgart.de/ubuntu xenial/multiverse amd64 ttf-mscorefonts-installer all 3.4+nmu1ubuntu2 [29,5 kB]
Fetched 29,5 kB in 0s (280 kB/s)                     
Preconfiguring packages ...
(Reading database ... 214933 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) ...
Processing triggers for update-notifier-common (3.168) ...
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/andale32.exe
Get:1 http://downloads.sourceforge.net/corefonts/andale32.exe [198 kB]
Fetched 198 kB in 1s (180 kB/s)                                                              
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)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/arial32.exe
Get:1 http://downloads.sourceforge.net/corefonts/arial32.exe [554 kB]
Fetched 554 kB in 1s (466 kB/s)                                                             
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: downloading http://downloads.sourceforge.net/corefonts/arialb32.exe
Get:1 http://downloads.sourceforge.net/corefonts/arialb32.exe [168 kB]
Fetched 168 kB in 0s (169 kB/s)                                                              
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/arialb32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/comic32.exe
Get:1 http://downloads.sourceforge.net/corefonts/comic32.exe [246 kB]
Fetched 246 kB in 1s (224 kB/s)                                                             
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/comic32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/courie32.exe
Get:1 http://downloads.sourceforge.net/corefonts/courie32.exe [646 kB]
Fetched 646 kB in 1s (472 kB/s)                                                               
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/courie32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/georgi32.exe
Get:1 http://downloads.sourceforge.net/corefonts/georgi32.exe [392 kB]
Fetched 392 kB in 1s (364 kB/s)                                                              
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/georgi32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/impact32.exe
Get:1 http://downloads.sourceforge.net/corefonts/impact32.exe [173 kB]
Fetched 173 kB in 0s (176 kB/s)                                                              
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/impact32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/times32.exe
Get:1 http://downloads.sourceforge.net/corefonts/times32.exe [662 kB]
Fetched 662 kB in 2s (235 kB/s)                                                              
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/times32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/trebuc32.exe
Get:1 http://downloads.sourceforge.net/corefonts/trebuc32.exe [357 kB]
Fetched 357 kB in 1s (307 kB/s)                                                              
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/trebuc32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/verdan32.exe
Get:1 http://downloads.sourceforge.net/corefonts/verdan32.exe [352 kB]
Fetched 352 kB in 4s (85,7 kB/s)                                                             
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/verdan32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/webdin32.exe
Get:1 http://downloads.sourceforge.net/corefonts/webdin32.exe [185 kB]
Fetched 185 kB in 0s (210 kB/s)                                                              
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/webdin32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

These fonts were provided by Microsoft "in the interest of cross-
platform compatibility".  This is no longer the case, but they are
still available from third parties.

You are free to download these fonts and use them for your own use,
but you may not redistribute them in modified form, including changes
to the file name or packaging format.

Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/andale32.exe
  extracting fontinst.inf
  extracting andale.inf
  extracting fontinst.exe
  extracting AndaleMo.TTF
  extracting ADVPACK.DLL
  extracting W95INF32.DLL
  extracting W95INF16.DLL

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/arial32.exe
  extracting FONTINST.EXE
  extracting fontinst.inf
  extracting Ariali.TTF
  extracting Arialbd.TTF
  extracting Arialbi.TTF
  extracting Arial.TTF

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/arialb32.exe
  extracting fontinst.exe
  extracting fontinst.inf
  extracting AriBlk.TTF

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/comic32.exe
  extracting fontinst.inf
  extracting Comicbd.TTF
  extracting Comic.TTF
  extracting fontinst.exe

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/courie32.exe
  extracting cour.ttf
  extracting courbd.ttf
  extracting courbi.ttf
  extracting fontinst.inf
  extracting couri.ttf
  extracting fontinst.exe

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/georgi32.exe
  extracting fontinst.inf
  extracting Georgiaz.TTF
  extracting Georgiab.TTF
  extracting Georgiai.TTF
  extracting Georgia.TTF
  extracting fontinst.exe

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/impact32.exe
  extracting fontinst.exe
  extracting Impact.TTF
  extracting fontinst.inf

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/times32.exe
  extracting fontinst.inf
  extracting Times.TTF
  extracting Timesbd.TTF
  extracting Timesbi.TTF
  extracting Timesi.TTF
  extracting FONTINST.EXE

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/trebuc32.exe
  extracting FONTINST.EXE
  extracting trebuc.ttf
  extracting Trebucbd.ttf
  extracting trebucbi.ttf
  extracting trebucit.ttf
  extracting fontinst.inf

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/verdan32.exe
  extracting fontinst.exe
  extracting fontinst.inf
  extracting Verdanab.TTF
  extracting Verdanai.TTF
  extracting Verdanaz.TTF
  extracting Verdana.TTF

All done, no errors.
Extracting cabinet: /var/lib/update-notifier/package-data-downloads/partial/webdin32.exe
  extracting fontinst.exe
  extracting Webdings.TTF
  extracting fontinst.inf
  extracting Licen.TXT

All done, no errors.
All fonts downloaded and installed.
Setting up ttf-mscorefonts-installer (3.4+nmu1ubuntu2) ...

2
这些似乎只是警告。我只是执行了相同的安装,并且在我的WPS Office中,所有这些字体都出现并正常工作。
Terrance

@Terrance我有与OP相同的问题,但是没有安装字体。如何解决呢?
Vistaus

@Vistaus实际上在安装字体的命令中有拼写错误。是sudo apt install ttf-mscorefonts-installer
Terrance

Answers:


18

这是Bug #1543280,虽然是相当无害的错误。安装成功完成。在W:表示这只是一个警告。

还要注意,这不仅与软件包无关ttf-mscorefonts-installer,而是只要apt访问已下载的文件,就会看到此警告。对于离线存储库也是如此。我有离线存储库,可用来在没有Internet的情况下更新软件包,而我自己总是在Xenial(16.04)中看到它。根本不是什么大问题。

为了方便起见,我显示了从本地存储库重新安装xrdp的输出。

sudo apt-get --reinstall install xrdp 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 398 not upgraded.
Need to get 0 B/215 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 file:/media/Linux/linux_debs_repo/xenial_new  xrdp 0.6.1-2 [215 kB]
(Reading database ... 612447 files and directories currently installed.)
Preparing to unpack ..././debs/xrdp_0.6.1-2_amd64.deb ...
Unpacking xrdp (0.6.1-2) over (0.6.1-2) ...
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.7.5-1) ...
Setting up xrdp (0.6.1-2) ...
N: Can't drop privileges for downloading as file '/media/Linux/linux_debs_repo/xenial_new/./debs/xrdp_0.6.1-2_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

检查有关Apt在Unix和Linux SE中的状态的问题apt-get更新退出状态

另一个相关的错误是#1570141


3
这对我有用,YMMV:$ sudo chown _apt:root / var / lib / update-notifier / package-data-downloads / partial /; $ sudo rm /var/lib/update-notifier/package-data-downloads/partial/*.FAILED; $ sudo apt install --reinstall update-notifier-common
mpag

1
在Xenial中,ms核心字体安装未成功完成,并且未安装字体!它在下载的第一个exe文件处停止。
SkyRaT

28

潜在的问题

用户'_apt'无法访问文件'/var/lib/update-notifier/package-data-downloads/partial/webdin32.exe',因此无法放弃下载特权。

这表明_apt用户无权写入/var/lib/update-notifier/package-data-downloads/partial目录或该目录中的任何现有文件。结果,安装程序将无法提取字体文件,从而无法(依次)更新(或首次安装)所指示的字体。

我认为与当前接受的答案(https://askubuntu.com/a/812152/269638)不同,该软件包因此没有正确安装。

你该怎么办?

首先,您需要使用以下命令来验证您是否具有此处_apt建议的用户:

getent passwd _apt

如果由于某种原因您没有该_apt用户并且需要安装说明,请转到上面指示的链接

接下来,您将希望将指定的目录以及其中包含的所有文件和子目录分配给_apt用户。您将要保留与root超级用户组以及因此与root用户帐户相关联的特权。在重新分配目录所有权之后,我们应该执行一些目录清理,然后最终确保正确安装了软件包及其相关性。

您需要的命令...

...在确认_apt用户确实存在后:

sudo chown -R _apt:root /var/lib/update-notifier/package-data-downloads/partial/
sudo rm /var/lib/update-notifier/package-data-downloads/partial/*.FA‌​ILED
sudo apt install --reinstall update-notifier-common ttf-mscorefonts-installer 

我从没想过我会这么说,但这是LXDE out执行Unity的一个实例。LXDE有一个用于管理用户和组的应用程序,而我还没有找到Unity的组管理应用程序,Unity附带的那个仅用于管理用户。如果我错了,请纠正我?顺便说一句,谢谢您的明确回答,并解释了为什么会出现此问题,这些解释有助于理解整个系统的操作并有助于找出将来的问题。希望他们能尽快得到正式的修正。
dginsd

1
像魅力一样工作:)
greuze '17

5

试试这个对我有用。

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

3
我知道这不是真正的Ubuntu解决方案,并且这种方法使发行版安装中毒了,但是从我的角度来看,如果您知道自己在做什么(在这种情况下这是非常安全的),那么这将是非常简单且快速的解决方案。
SkyRaT

1
对于Xenial,这似乎是必要的,因为即使根据@mpag修复了权限,本机程序包也会失败,如下所示。ttf-mscorefonts-installer:下载downloads.sourceforge.net/corefonts/andale32.exe错误:1 downloads.sourceforge.net/corefonts/andale32.exe禁止 从https重定向到“ downloads.sourceforge.net/…
Marcel Waldvogel
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.