潜在问题

潜在问题

我想在 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) ...

答案1

潜在问题

无法删除下载权限,因为用户“_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 

答案2

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

还要注意,这不仅仅与软件包有关ttf-mscorefonts-installer,而是每当apt访问已下载的文件时,您都会看到此警告。离线存储库也会发生这种情况。我有离线存储库,我用它来在没有互联网的情况下更新软件包,我自己在 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)

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

另一个相关的错误是#1570141

答案3

尝试一下,它对我有用。

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

答案4

这个简单的事情对我有用;

  • 将文件复制到/_remove/package.deb
  • apt-get -y install /_remove/package.deb

我之前已以 root 身份下载该文件并将其保存在 root 的路径中。

相关内容