linux – 在ec2上安装mscorefonts

提问

我试图在ec2上安装mscorefonts,但是我似乎无法找到终端命令的神奇组合来实现它.我正在使用m1.medium实例和uname -a返回Linux worker 3.11.0-12-generic#19-Ubuntu SMP Wed 10月9日16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU / Linux

在我的个人笔记本电脑上运行:sudo apt-get install -y ttf-mscorefonts-installer工作正常,但是在我的ec2实例上我收到以下错误消息:

以下包具有未满足的依赖项:
 ttf-mscorefonts-installer:取决于:defoma但它不可安装
                             建议:ttf-liberation但它不可安装
                             建议:x-ttcidfont-conf但它不可安装

实际上,我还没有找到安装任何这些组件的方法.我试图用以下方法修改我的/etc/apt/sources.list文件:

deb http://us.archive.ubuntu.com/ubuntu/清醒多元宇宙
deb-src http://us.archive.ubuntu.com/ubuntu/清醒多元宇宙
deb http://us.archive.ubuntu.com/ubuntu/清醒更新多元宇宙
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse

如图所示:Getting Microsoft Calibri font on Amazon EC2 ubuntu,但即使在运行sudo apt-get update之后,我仍然没有成功.如何在ec2上安装mscore字体?我的应用程序需要它们才能运行

最佳答案

最终我想出来了.我的解决方案是启用多元宇宙ppa.这是我使用的脚本.

#font installation -- required to properly display fonts used in 
echo "deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ saucy multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ saucy multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ saucy-updates multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ saucy-updates multiverse" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
# preselect yes for ms EULA
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install -y ttf-mscorefonts-installer

这适用于2015年1月的EC2 ubuntu以及运行ubuntu 14.04的本地机器.