Is it possible to change a mirror where ttf-mscorefonts-installer downloads fonts from? Currently, e.g. http://downloads.sourceforge.net/corefonts/arial32.exe is blocked from my company office, but I can see that e.g. https://cfhcable.dl.sourceforge.net/project/corefonts/the%20fonts/final/arial32.exe works.
1 Answer
You can download the fonts from the mirror of your choosing, then run update-ms-fonts
to use them. You won't want to download each one by hand, so you can use the procedure in Videonauth's answer to How to install the package ttf-mscorefonts-installer. Since that procedure, as written, would download the fonts with the downloads.sourceforge.net
URLs you can't use, you'll have to change it to use the cfhcable.dl.sourceforge.net
URLs. Here's a modified procedure:
Install
ttf-mscorefonts-installer
in the usual way. That is, run these commands and accept the license:sudo apt update sudo apt install ttf-mscorefonts-installer
You may see this stall, typically for less than half a minute:
0% [Connecting to downloads.sourceforge.net (216.105.38.13)]
And then an error that looks like this:
Err:1 http://downloads.sourceforge.net/corefonts/andale32.exe Could not connect to downloads.sourceforge.net:80 (216.105.38.13), connection timed out E: Failed to fetch http://downloads.sourceforge.net/corefonts/andale32.exe Could not connect to downloads.sourceforge.net:80 (216.105.38.13), connection timed out E: Download Failed
That's okay. At least currently, the installer doesn't continue to attempt to connect for subsequent files.
Make a temporary directory and
cd
to it. I prefer to just create atmp
subdirectory of my home directory and delete it when I'm done. If you script this, you're better off making the directory in the way Videonauth suggests.mkdir ~/tmp cd ~/tmp
If that directory already exists, I suggest not using it, deleting its contents, or at least making sure it doesn't have any files in it whose names end in
.exe
before continuing.Download the fonts, substituting the URLs you want to use. This is the part that differs importantly from the procedure in Videonauth's answer.
awk '/Url/ {sub("downloads[.]sourceforge[.]net/corefonts","cfhcable.dl.sourceforge.net/project/corefonts/the%20fonts/final",$2); system("wget "$2)}' /usr/share/package-data-downloads/ttf-mscorefonts-installer
Run
update-ms-fonts
. This only accepts absolute paths (so you can't write*.exe
instead of~/tmp/*.exe
). If your temporary directory isn't thetmp
subdirectory of your home directory, adjust the command accordingly.sudo /usr/lib/msttcorefonts/update-ms-fonts ~/tmp/*.exe
Update the timestamp on the file APT uses to determine what installation steps still need to be completed:
sudo touch /var/lib/update-notifier/package-data-downloads/ttf-mscorefonts-installer
You should be able to use the fonts now, and you shouldn't get any Software Updater dialog boxes about how files need to be downloaded.
Delete the temporary directory:
cd rm -r tmp
Credit goes to Videonauth for writing that answer, from which this answer is derived.
wget
them from the other source instead. I've posted an answer about how to do that.