permission error when installing ttf-mscorefonts-installer/Can't drop privileges as file couldn't be accessed by user '_apt'
The underlying problem
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'.
This is indicating that the _apt
user doesn't have access to write to the /var/lib/update-notifier/package-data-downloads/partial
directory, or to any existing files there. As a consequence, the installation will not be able to extract font files to - in turn - update (or install for the first time), the indicated fonts.
I contend that the package is therefore NOT properly installed, unlike the currently accepted answer (https://askubuntu.com/a/812152/269638).
What should you do?
First, you'll want to verify that you have an _apt
user as suggested here with the following command:
getent passwd _apt
If for some reason you do not have the _apt
user and need instructions for installing it, please go to the link indicated above.
Next, you will want to assign the directory indicated, as well as all files and subdirectories contained within, to the _apt
user. You'll want to retain the privileges associated with root
superuser group and consequently the root
user account. Following the reassignment of ownership of the directory, we should perform some directory clean-up and then finally ensure that the packages and their dependencies are properly installed.
The commands you need...
...after verifying that the _apt
user does indeed exist:
sudo chown -R _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 ttf-mscorefonts-installer
This is the bug #1543280, though a rather harmless bug. The installation is completed successfully. The W:
signifies that this is just a warning.
Also note that, This is not related with the package ttf-mscorefonts-installer
solely, instead whenever apt
access already downloaded files, you'll see this warning. It happens also for offline repositories. I have offline repositories which I use to update packages without Internet and I myself see this always in Xenial (16.04). Not a big problem at all.
For your convenience, I am showing the output of reinstalling xrdp from my local repository.
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)
Check this question about Apt's status in Unix and Linux SE apt-get update exit status
Another related bug is #1570141
Try this it worked for me.
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