LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 950|回复: 8

Help! Some directories in /usr/share were deleted in a accident,

[复制链接]
发表于 2008-3-2 23:05:43 | 显示全部楼层 |阅读模式
Hi all,

I deleted some directories in /usr/share in a accident, and now I even do not know which were deleted.
and now somethings in X do not work, such as hotkey.

How can I recover the whole system?

Thanks for any advice in advance.
发表于 2008-3-2 23:21:57 | 显示全部楼层
emerge -e system?
回复 支持 反对

使用道具 举报

发表于 2008-3-2 23:23:19 | 显示全部楼层
先看看history,都干了什么,再说。这样太笼统了。缺什么补回去就行了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-2 23:28:17 | 显示全部楼层
I did a stupdi command " rm -/usr/share" and I interrupt the command in a second.

And what I concern is if to "emerge e system" or "emerge world" coz I think there are some applications were installed to /usr/share besides system files.
回复 支持 反对

使用道具 举报

发表于 2008-3-3 00:21:03 | 显示全部楼层
其实你可以写个脚本自己查查
思路:
foreach @all_packages_in_box {
list all the files in the package
test if each of the files still exists
if any of them disappears, print package name
}
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-3 00:48:44 | 显示全部楼层
Post by zhllg;1822326
其实你可以写个脚本自己查查
思路:
foreach @all_packages_in_box {
list all the files in the package
test if each of the files still exists
if any of them disappears, print package name
}


This is the greatest idea !!!
回复 支持 反对

使用道具 举报

发表于 2008-3-3 04:49:57 | 显示全部楼层
foreach里边用 equery k package 比较方便,不用自己麻烦,就是要检查返回结构了。:)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-3 11:23:29 | 显示全部楼层
Post by 晨想;1822361
foreach里边用 equery k package 比较方便,不用自己麻烦,就是要检查返回结构了。:)

I had thought to create a package list by "genlop -l" and remove the redundancy with a simple perl script.
回复 支持 反对

使用道具 举报

发表于 2008-3-4 17:22:31 | 显示全部楼层
这样行么?
  1. qlop -l | awk '{print $7}' | sort | sed -n "s/\(.*\)-[0-9].*/\1/p" | uniq
复制代码

不过好象还会剩下不少已经被emerge -C的包
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表