Chinaunix首页 | 论坛 | 博客
  • 博客访问: 11438
  • 博文数量: 4
  • 博客积分: 250
  • 博客等级: 二等列兵
  • 技术积分: 65
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-13 10:36
文章分类

全部博文(4)

文章存档

2008年(4)

我的朋友
最近访客

分类: LINUX

2008-08-06 15:10:26

这几天装RHEL5装中文包的时候总是出现failed to write cache错误,然后中问没办法正常显示,很是苦恼,终于找到了解决方案,以上是引用别人的帖子,红字部分为解决的方法。
 
看不明白,但是问题解决,以后慢慢的来搞清楚是什么意思。
 
前几天在虚拟机上安装ubuntu 7.04 64bit时,遇到了一个经典的bug:failed to write cache.由fc-cache -fv命令导致的。

google之后找到了两个解决的方法,觉得很有必要记录一下

方法之一,比较简单,写了一个很简单的脚本,然后执行下就可以了,内容如下:

#!/bin/bash
#
# 修正 Ubuntu 7.04 fc-cache failed to write cache 错误
#sudo touch /usr/share/fonts
sudo touch /usr/share/fonts/X11
sudo touch /usr/share/fonts/X11/100dpi
sudo touch /usr/share/fonts/X11/75dpi
sudo touch /usr/share/fonts/X11/Type1
sudo touch /usr/share/fonts/X11/encodings
sudo touch /usr/share/fonts/X11/encodings/large
sudo touch /usr/share/fonts/X11/misc
sudo touch /usr/share/fonts/X11/util
sudo touch /usr/share/fonts/truetype
sudo touch /usr/share/fonts/truetype/arphic
sudo touch /usr/share/fonts/truetype/baekmuk
sudo touch /usr/share/fonts/truetype/freefont
sudo touch /usr/share/fonts/truetype/kochi
sudo touch /usr/share/fonts/truetype/openoffice
sudo touch /usr/share/fonts/truetype/thai
sudo touch /usr/share/fonts/truetype/ttf-arabeyes
sudo touch /usr/share/fonts/truetype/ttf-bengali-fonts
sudo touch /usr/share/fonts/truetype/ttf-bitstream-vera
sudo touch /usr/share/fonts/truetype/ttf-dejavu
sudo touch /usr/share/fonts/truetype/ttf-devanagari-fonts
sudo touch /usr/share/fonts/truetype/ttf-gentium
sudo touch /usr/share/fonts/truetype/ttf-gujarati-fonts
sudo touch /usr/share/fonts/truetype/ttf-kannada-fonts
sudo touch /usr/share/fonts/truetype/ttf-lao
sudo touch /usr/share/fonts/truetype/ttf-malayalam-fonts
sudo touch /usr/share/fonts/truetype/ttf-mgopen
sudo touch /usr/share/fonts/truetype/ttf-oriya-fonts
sudo touch /usr/share/fonts/truetype/ttf-punjabi-fonts
sudo touch /usr/share/fonts/truetype/ttf-tamil-fonts
sudo touch /usr/share/fonts/truetype/ttf-telugu-fonts
sudo touch /usr/share/fonts/type1
sudo touch /usr/share/fonts/type1/gsfonts
sudo touch /usr/share/X11/fonts
sudo touch /usr/share/X11/fonts/100dpi
sudo touch /usr/share/X11/fonts/75dpi
sudo touch /usr/share/X11/fonts/Type1
sudo touch /usr/share/X11/fonts/encodings
sudo touch /usr/share/X11/fonts/encodings/large
sudo touch /usr/share/X11/fonts/misc
sudo touch /usr/share/X11/fonts/util
sudo touch /usr/local/share/fonts
sudo touch /var/lib/defoma/fontconfig.d
sudo touch /var/lib/defoma/fontconfig.d/A
sudo touch /var/lib/defoma/fontconfig.d/B
sudo touch /var/lib/defoma/fontconfig.d/C
sudo touch /var/lib/defoma/fontconfig.d/D
sudo touch /var/lib/defoma/fontconfig.d/E
sudo touch /var/lib/defoma/fontconfig.d/F
sudo touch /var/lib/defoma/fontconfig.d/G
sudo touch /var/lib/defoma/fontconfig.d/H
sudo touch /var/lib/defoma/fontconfig.d/J
sudo touch /var/lib/defoma/fontconfig.d/K
sudo touch /var/lib/defoma/fontconfig.d/L
sudo touch /var/lib/defoma/fontconfig.d/M
sudo touch /var/lib/defoma/fontconfig.d/N
sudo touch /var/lib/defoma/fontconfig.d/O
sudo touch /var/lib/defoma/fontconfig.d/P
sudo touch /var/lib/defoma/fontconfig.d/R
sudo touch /var/lib/defoma/fontconfig.d/S
sudo touch /var/lib/defoma/fontconfig.d/T
sudo touch /var/lib/defoma/fontconfig.d/U
sudo touch /var/lib/defoma/fontconfig.d/V
sudo touch /var/lib/defoma/fontconfig.d/a
sudo touch /var/lib/defoma/fontconfig.d/j
sudo touch /var/lib/defoma/fontconfig.d/m
sudo touch /var/lib/defoma/fontconfig.d/u

方法之二,很让我喜欢:

sudo fc-cache -fv 2>&1 | grep failed | cut -f1 -d”:” | xargs -i sudo touch {} && sudo fc-cache -fv

方法一比较的简单,当然也很实用

方法二充分利用了linux的命令,通过管道连接和一系列规则的运用,解决了问题。

相比较而言,我更喜欢第二个方法,shell真的很强大。最近就在翻一本学习bash的书,过段时间打算写几篇有关bash编程的日志,也算是自己学习的记录。
阅读(1050) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~