版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://young001.blogbus.com/logs/42067565.html
pac-file: An ArchLinux Version of Debian's apt-file
pacfile是个apt-file功能实现的archlinux版本
Ever since I began using ArchLinux, I have wanted a utility similar to debian's apt-file that allows you to discover which package provides a particular file. Arch's package manager, pacman, has always allowed you to do this for a file you already have installed, via pacman -Qo /path/to/file but this doesn't help if the file isn't already present on your system.
自从我开始使用archlinux,我就想要有个工具能实现跟debian的apt-file功能类似来查询一个文件包含什么文件。archlinux的包管理器pacman提供了相似的功能,只需要 pacman -Qo /path/to/file就可以实现,但是这个方法有个缺点,它只能是查询你安装了的软件,对于没有安装的软件就没有用武之地了
Recently, ArchLinux's developers have decided to provide filelists containing the contents of each package in a repository on the repo mirrors (see discussion). I've written a utility pac-file that downloads and uncompresses the filelists for each repository enabled in /etc/pacman.conf and allows regex searching of them. This allows the user to discover which package contains a file, even if that package is not installed on the user's system.
最近archlinux的开发人员已经决定提供filelist,这是个描述每个包包含什么文件的一个包,存储在软件库中。我写了一个小工具叫做pacfile来下载解压这个文件,这样就可以查询。这样就可以发现包包含文件,即使你没有安装这个文件。
Suppose you are compiling a program and get an error about a missing library libImath.so To know which package to install to provide this dependency you could:
假设你正在编译一个软件,但是得到了一个缺少函数库的错误,你可以通过这个来了解什么包可以提供这些函数库
$ pac-file libImath.so
extra/openexr-1.4.0a-2 usr/lib/libImath.so.4
extra/openexr-1.4.0a-2 usr/lib/libImath.so.4.0.0
extra/openexr-1.4.0a-2 usr/lib/libImath.so
The output indicates that you should install openexr from the extra repo. pac-file searches via grep's extended regex engine, so searches like lib[Ii]math.so or lib*math work as expected.
Usage
这个输出就是可以告诉你你需要的软件在extra这个软件库中,叫做openexr,这个软件的搜寻是通过grep来的,所以你还可以支持 lib[Ii]math.so 或者lib*math等grep查询方式,他们照样可以。
pac-file is designed to be similar to pacman. You must first syncronize (via -S or --sync) the filelists. This must be done as root because the filelists are stored in /var/lib/pacman/filelists (although this can be changed in the script). See pac-file -h for more information.
pacfile的设计就是和pacman很像,你首先需要同步filelists,这个必须需要root权限因为这个文件存放在/var/lib/pacman/filelists ,尽管你可以修改路径,想要知道更多关于pacfile的就用pacfile -h
pac-file这个工具使用的命令是pacfile不是网上说的pac-file(young001注)
pacfile介绍
-
- 帖子: 62
- 注册时间: 2008-10-04 20:34
- 来自: young001.blogbus.com
- 联系:
pacfile介绍
http://young001.blogbus.com
努力做自己的博客,欢迎来踩
努力做自己的博客,欢迎来踩