Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have an "old" Ubuntu 11.10 server. I have a new (Amazon EC2) Ubuntu 11.10 server. I can only access them through the command line.

How can I migrate all the installed fonts from the old machine to the new machine?

I assume it is just copying some subdirectories. Is it that easy?

Background: I am running tests on my software, on both machines and it is giving different results, because the available fonts are different. (And the tests are sensitive to changes in pixels.)

share|improve this question
add comment

2 Answers

I researched the answer to my own question:

There are three phases required.

  1. Find the font files.
  2. Copy the missing files.
  3. Update the font cache.

Finding the Font Files

Look inside /etc/fonts/fonts.conf. It contains a number of different directories, marked with <dir> and </dir> tags.

In practice, I found 4 directories listed, of which 3 were empty or non-existent. Note: One is probably ~/.fonts, which is on a per-user basis.

Copying the Font Files

Copy the font files from each directory into the corresponding directory on the target.

I only bothered moving the files that were missing at the destination.

Updating the Font Cache

On the destination machine, run:

sudo fc-cache -f -v

(If fc-cache is not available, you need to install fontconfig, e.g. sudo apt-get install fontconfig)

share|improve this answer
add comment

What do you mean by command line access ?

Do you have ssh access ??? Then you could copy the directories via scp.

scp -r UID1@hist1:/dironhost1 UID2@host2:/dironhost2

share|improve this answer
    
Thanks, but I am afraid you've missed my point. I know how to copy files - I don't (didn't) know which files to copy and whether that was enough (it isn't). –  Oddthinking Apr 19 '12 at 10:04
    
Did you install the fonts via package manager or "manually"? –  Ruediger Apr 19 '12 at 10:16
    
I did not deliberately install any fonts. There were all installed as side-effects of installing other packages (e.g. firefox). –  Oddthinking Apr 19 '12 at 10:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.