因为不怎么好排版,就做个连接了:
http://download.ourlinux.net/archlinux/book/man/pacman.html
pacman Section: (8) Updated: September 17, 2004
翻译者:翟翔 legendren2008@yahoo.com.cn 翻译最后更新:2005年3月11日星期五
提要:
pacman命令中文翻译
<!--break-->
Index
NAME名称
pacman - package manager utility包管理
SYNOPSIS概要
pacman <operation> [options] <package> [package] ...
pacman <操作> [选项] <包> [包] ...
DESCRIPTION描述
pacman is a package management utility that tracks installed packages on a linux system. It has simple dependency support and the ability to connect to a remote ftp server and automatically upgrade packages on the local system. pacman package are gzipped tar format.
pacman是一个用来跟踪linux系统上已安装包的实用包管理。它具有简单的依赖性支持和具有连接远端ftp服务器的能力,可以自动更新本地系统的包。Pacman包是gzipped tar格式。
OPERATIONS操作
-A, --add
Add a package to the system. Package will be uncompressed into the installation root and the database will be updated.
向系统添加一个包。包将被解压缩到安装目录,且数据库将被更新。
-F, --freshen
This is like --upgrade except that, unlike --upgrade, this will only upgrade packages that are already installed on your system.
这个命令和—upgrade不完全一样,它仅仅更新已经安装在你的系统上的包。
-Q, --query
Query the package database. This operation allows you to view installed packages and their files, as well as meta-info about individual packages (dependencies, conflicts, install date, build date, size). This can be run against the local package database or can be used on individual .tar.gz packages. See QUERY OPTIONS below.
搜寻包数据库。这个操作允许你浏览已安装的包和它们的文件,同样还有关于单个包(依赖性,冲突性,安装日期,创建日期,大小)的meta信息。这个可以用来运行在本地包数据库或者可以用于单个.tar.gz包。参阅下面的QUERY选项。
-R, --remove
Remove a package from the system. Files belonging to the specified package will be deleted, and the database will be updated. Most configuration files will be saved with a .pacsave extension unless the --nosave option was used.
从系统中移除一个包。归属于这个特定包的文件将要被删除,而且数据库也要被更新。配置文件将以.pacsave的后缀名存储,除非使用了—nosave选项。
-S, --sync
Synchronize packages. With this function you can install packages directly from the ftp servers, complete with all dependencies required to run the packages. For example, pacman -S qt will download qt and all the packages it depends on and install them. You could also use pacman -Su to upgrade all packages that are out of date (see below).
同步包。使用这个功能你可以直接通过ftp服务器安装包,包括了所有的依赖性来运行包。比如,pacman -S qt将下载qt和所有的依赖性包,并安装它们。你同样可以使用pacman –Su来更新所有的废弃的包(参看下面)。
-U, --upgrade
Upgrade a package. This is essentially a "remove-then-add" process. See HANDLING CONFIG FILES for an explanation on how pacman takes care of config files.
更新一个包。它本质上是一个"移除-并-添加"的过程。参阅操作配置文件来了解pacman是如何管理配置文件的。
-V, --version
Display version and exit.
显示版本并退出。
-h, --help
Display syntax for the given operation. If no operation was supplied then the general syntax is shown.
显示该操作的语法。如果没有提供操作,那么将显示常规的语法。
OPTIONS选项
-d, --nodeps
Skips all dependency checks. Normally, pacman will always check a package's dependency fields to ensure that all dependencies are installed and there are no package conflicts in the system. This switch disables these checks.
越过所有的依赖性检测。一般的,pacman总要检测一个包的依赖性文件来确保所有的依赖性文件已经被安装并且系统中没有冲突的包。这个选项取消了这些检测。
-f, --force
Bypass file conflict checks, overwriting conflicting files. If the package that is about to be installed contains files that are already installed, this option will cause all those files to be overwritten. This option should be used with care, ideally not at all.
绕开冲突文件检测,覆盖冲突文件。如果将要安装的包中包含了已经被安装的文件,这个选项将把这些文件覆盖。这个选项要小心使用,完全是理论上的。
-r, --root <path>
Specify alternative installation root (default is "/"). This should not be used as a way to install software into e.g. /usr/local instead of /usr. Instead this should be used if you want to install a package on a temporary mounted partition, which is "owned" by another system. By using this option you not only specify where the software should be installed, but you also specify which package database to use.
指定安装路径(默认是"/")。如果把安装软件的路径从/usr/local改为/usr,就没有必要使用这个选项。如果你想在临时挂载的分区上(被其他的系统所“拥有”)安装一个包,那么就可以使用这个选项。使用这个选项是指定数据库使用哪个包,而不仅仅是指定把软件安装在何处。
-v, --verbose
Output more status and error messages.
输出更多的状态和错误信息。
--config <path>
Specify an alternate configuration file.
指定一个配置文件。
--noconfirm
Bypass any and all "Are you sure?" messages. It's not a good to do this unless you want to run pacman from a script.
绕过所有“你确定么?”信息。最好不要这样做,除非是通过脚本运行pacman。
SYNC OPTIONS同步选项
-c, --clean
Remove old packages from the cache. When pacman downloads packages, it saves them in /var/cache/pacman/pkg. If you need to free up diskspace, you can remove these packages by using the --clean option. Using one --clean (or -c) switch will only remove old packages. Use it twice to remove all packages from the cache.
从缓存中移除旧的包。当pacman下载包时,它把包保存在/var/cache/pacman/pkg下。如果你想释放硬盘空间,你可以使用—clean选项来移除这些包。使用一次—clean(或-c)选项仅仅会移除旧的包。使用两次就可以从缓存中移除所有的包。
-g, --groups
Display all the members for each package group specified. If no group names are provided, all groups will be listed.
为每个指定的组显示所有的成员。如果没有提供组的名称,将列出所有的组。
-i, --info
Display dependency information for a given package. This will search through all repositories for a matching package and display the dependencies, conflicts, etc.
显示该包的依赖信息。将搜遍所有的库来找到匹配的包,并显示依赖性,冲突性等。
-l, --list
List all files in the specified repositories. Multiple repositories can be specified on the command line.
显示在指定库中的所有文件。多个库可以在单行命令中指定。
-p, --print-uris
Print out URIs for each specified package and its dependencies. These can be piped to a file and downloaded at a later time, using a program like wget.
打印每个指定的包和它的依赖性的URIs。可以重定向输出到文件中,随后下载,使用像wget的程序。
-s, --search <string>
This will search each package in the package list for names or descriptions that contains <string>.
这个将搜遍在包列表中的每个包含<字符串>的包以得知名称或依赖性。
-u, --sysupgrade
Upgrades all packages that are out of date. pacman will examine every package installed on the system, and if a newer package exists on the server it will upgrade. pacman will present a report of all packages it wants to upgrade and will not proceed without user confirmation. Dependencies are automatically resolved at this level and will be installed/upgraded if necessary.
更新所有废弃的包。pacman将检查每个安装在系统上的包,如果系统上存在更新的包,它将更新。pacman将提交所有它想更新的包的报表,不过没有用户的确认它是不会提交的。依赖性在这一层上会被自动解决,如果有必要,还会被安装/更新。
-w, --downloadonly
Retrieve all packages from the server, but do not install/upgrade anything.
找回服务器上的所有包,但是不安装/更新任何东东。
-y, --refresh
Download a fresh copy of the master package list from the ftp server defined in /etc/pacman.conf. This should typically be used each time you use --sysupgrade.
从ftp服务器上下载一份新的主要的包列表定义在/etc/pacman.conf。每次你使用—sysupgrade时,将会被调用。
--ignore <pkg>
This option functions exactly the same as the IgnorePkg configuration directive. Sometimes it can be handy to skip some package updates without having to edit pacman.conf each time.
这个选项的功能完全和IgnorePkg配置一样。有时候没有编辑pacman.conf,它很难越过某些包的更新。
REMOVE OPTIONS移除选项
-c, --cascade
Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive.
移除所有的对象,同时也移除那些依赖一个或多个对象包。这个选项是递归的。
-k, --keep
Removes the database entry only. Leaves all files in place.
仅仅移除数据库进入。保留所有的文件在适当的位置。
-n, --nosave
Instructs pacman to ignore file backup designations. Normally, when a file is about to be removed from the system the database is first checked to see if the file should be renamed to a .pacsave extension. If --nosave is used, these designations are ignored and the files are removed.
命令pacman忽略文件备份指令。通常的,当一个文件要从系统中移除时,数据库首先检测看看是否文件需要以.pacsave的后缀名来重命名。如果使用了—nosave,这些指令就被忽略并且文件被移除。
-s, --recursive
For each target specified, remove it and all its dependencies, provided that (A) they are not required by other packages; and (B) they were not explicitly installed by the user. This option is analagous to a backwards --sync operation.
针对每个指定的对象,移除它和它的依赖性,假如(A)它们没有被其他的包需求;(B)它们没有正确地被用户安装。这个选项类似于—sync操作相反选项。
QUERY OPTIONS查询选项
-e, --orphans
List all packages that were explicitly installed (ie, not pulled in as a dependency by other packages) and are not required by any other packages.
列出没有正确安装的所有包(比如,没有被其他包作为一种依赖),没有被其他的包需求。
-g, --groups
Display all groups that a specified package is part of. If no package names are provided, all groups and members will be listed.
显示所有被区分的指定包的组。如果没有提供包名,所有的组和成员将被显示出来。
-i, --info
Display information on a given package. If it is used with the -p option then the .PKGINFO file will be printed.
显示该包的信息。如果使用了-p选项,那么.PKGINFO文件将被打印出来。
-l, --list
List all files owned by <package>. Multiple packages can be specified on the command line.
列出<包>拥有的所有文件。多个包可以指定在单行命令里。
-o, --owns <file>
Search for the package that owns <file>.
搜索包含<文件>的包。
-p, --file
Tells pacman that the package supplied on the command line is a file, not an entry in the database. Pacman will decompress the file and query it. This is useful with --info and --list.
告诉pacman命令行上的包是一个文件,不是一个进入数据库的入口。Pacman将压缩文件并搜寻它。和--info和—list配套起来很有用。
-s, --search <string>
This will search each locally-installed package for names or descriptions that contains <string>.
这个将会搜索每个包含了<字符串>的本地安装包的名称或描述。
HANDLING CONFIG FILES操作配置文件
pacman uses the same logic as rpm to determine action against files that are designated to be backed up. During an upgrade, it uses 3 md5 hashes for each backup file to determine the required action: one for the original file installed, one for the new file that's about to be installed, and one for the actual file existing on the filesystem. After comparing these 3 hashes, the follow scenarios can result:
pacman使用同rpm一样的逻辑来决定针对指定为备份文件的操作。在更新过程中,它为每个备份文件使用3个md5哈希表来决定所需要的操作:一个是原始安装文件,一个是将要被安装的新文件,和在文件系统中确实存在的文件。比较完这3个哈希表,结果将会像如下这样显示:
original=X, current=X, new=X 原始的= X,当前的= X,新的= X(下同)
All three files are the same, so we win either way. Install the new file.
这3个文件是相同的,所以我们成功了(puzzled)。安装新文件。
original=X, current=X, new=Y
The current file is un-altered from the original but the new one is different. Since the user did not ever modify the file, and the new one may contain improvements/bugfixes, we install the new file.
当前的文件没有更改原始文件,但是新文件就已经变动了。即便用户从来没有更改文件,而且新文件可能包含了更新/解决bug,我们安装这个新文件。
original=X, current=Y, new=X
Both package versions contain the exact same file, but the one on the filesystem has been modified since. In this case, we leave the current file in place.
包版本包含了完全相同的文件,但是在文件系统上的文件曾被更改了。如果这样的话,我们就把当前文件保留在恰当的位置。
original=X, current=Y, new=Y
The new one is identical to the current one. Win win. Install the new file.
新文件和当前文件是一样的。成功。安装新文件。
original=X, current=Y, new=Z
All three files are different. So we install the new file, but back up the old one to a .pacsave extension. This way the user can move the old configuration file back into place if he wishes.
这3个文件都不相同。所以我们安装新文件,但是要以.pacsave后缀名备份旧文件。这样用户可以移动旧的配置文件到他希望放置的地方。
CONFIGURATION配置
pacman will attempt to read /etc/pacman.conf each time it is invoked. This configuration file is divided into sections or repositories. Each section defines a package repository that pacman can use when searching for packages in --sync mode. The exception to this is the options section, which defines global options.
pacman将尝试读取/etc/pacman.conf当它被调用的时候。这个配置文件被分为区块儿或库。每个区块儿定义一个包的库,这样pacman可以在—sync模式下搜索包的时候使用。针对这个的异常是选项区块儿,定义全局选项。
Example:例子:
[options][选项]
NoUpgrade = etc/passwd etc/group etc/shadow
NoUpgrade = etc/fstab
Include = /etc/pacman.d/current
[custom][自定义]
Server = file:///home/pkgs
CONFIG: OPTIONS配置:选项
DBPath = path/to/db/dir
Overrides the default location of the toplevel database directory. The default is var/lib/pacman.
把默认的数据库路径指向顶级目录。默认的是var/lib/pacman。
HoldPkg = <package> [package] ...
If a user tries to --remove a package that's listed in HoldPkg, pacman will ask for confirmation before proceeding.
如果一个用户试着—remove一个位于HoldPkg包,pacman将会在处理之前询问是否确认。
IgnorePkg = <package> [package] ...
Instructs pacman to ignore any upgrades for this package when performing a --sysupgrade.
当执行一个—sysupgrade时,命令pacman忽略针对这个包的任何更新。
Include = <path>
Include another config file. This config file can include repositories or general configuration options.
包含另一个配置文件。这个配置文件可以包含库或一般的配置选项。
ProxyServer = <host|ip>[:port]
If set, pacman will use this proxy server for all ftp/http transfers.
如果设置了,pacman将使用这个代理服务器来传递所有的ftp/http。
XferCommand = /path/to/command %u
If set, pacman will use this external program to download all remote files. All instances of %u will be replaced with the URL to be downloaded. If present, instances of %o will be replaced with the local filename, plus a ".part" extension, which allows programs like wget to do file resumes properly.
如果设置了,pacman将使用这个外部的程序下载所有远端文件。所有%u将会被下载的URL所代替。如果呈现,%o将会被本地文件名所替代,并加上一个".part"的后缀名,这样就可以允许像wget这样的程序正常地断点续传文件。
This option is useful for users who experience problems with pacman's built-in http/ftp support, or need the more advanced proxy support that comes with utilities like wget.
这个选项对于经历了pacman的嵌入http/ftp支持产生的问题的用户来说很有用,或需要更高级的代理支持来源于像wget的使用。
NoPassiveFtp
Disables passive ftp connections when downloading packages. (aka Active Mode)
当正在下载包时,中止主动模式的ftp连接。(aka主动模式)
NoUpgrade = <file> [file] ...
All files listed with a NoUpgrade directive will never be touched during a package install/upgrade. Note: do not include the leading slash when specifying files.
当包安装/更新过程中,使用了NoUpgrade指示的列表文件永远不会被触及了。注意:当指定文件时,不要包含引领的slash表。
UseSyslog
Log action messages through syslog(). This will insert pacman log entries into your /var/log/messages or equivalent.
通过syslog()记录操作信息日志。这个将会被插入到pacman的日志,放置到/var/log/或相同的地方。
LogFile = /path/to/file
Log actions directly to a file, usually /var/log/pacman.log.
把日志操作记录在一个文件里,通常是/var/log/pacman.log。
CONFIG: REPOSITORIES配置:库
Each repository section defines a section name and at least one location where the packages can be found. The section name is defined by the string within square brackets (eg, the two above are 'current' and 'custom'). Locations are defined with the Server directive and follow a URL naming structure. Currently only ftp is supported for remote servers. If you want to use a local directory, you can specify the full path with a 'file://' prefix, as shown above.
每个库区块儿定义一个区块儿名和至少一个可以找到包的位置。区块儿名是用方括号包含的字符串来定义(比如,上面的‘当前’和‘自定义’)。位置用指示的服务器和一个URL命名结构。通常的,仅仅ftp支持远端服务器。如果你想使用本地路径,你可以使用'file://'前缀来指定完整路径,就像上面显示的。
USING YOUR OWN REPOSITORY使用你自己的库
Let's say you have a bunch of custom packages in /home/pkgs and their respective PKGBUILD files are all in /var/abs/local. All you need to do is generate a compressed package database in the /home/pkgs directory so pacman can find it when run with --refresh.
# gensync /var/abs/local /home/pkgs/custom.db.tar.gz
假设你在/home/pkgs下有一捆自定义包,并且它们各自的PKGBUILD文件全都在/var/abs/local。你只需要在/home/pkgs目录下生成一个压缩的数据库包,这样当运行带—refresh选项的时候, pacman可以找到它。
# gensync /var/abs/local /home/pkgs/custom.db.tar.gz
The above command will read all PKGBUILD files in /var/abs/local and generate a compressed database called /home/pkgs/custom.db.tar.gz. Note that the database must be of the form {treename}.db.tar.gz, where {treename} is the name of the section defined in the configuration file. That's it! Now configure your custom section in the configuration file as shown in the config example above. Pacman will now use your package repository. If you add new packages to the repository, remember to re-generate the database and use pacman's --refresh option.
上面的命令将读取在/var/abs/local下的所有的PKGBUILD文件,并生成一个压缩的名为/home/pkgs/custom.db.tar.gz数据库。注意数据库必须遵循{treename}.db.tar.gz的格式,其中{treename}是定义在配置文件中的区块儿名。就这样了!现在配置你在配置文件中的自定义的区块儿,就像上面显示的配置例子一样。Pacman现在将使用你的包库。如果你向库中添加新的包,记住要重新生成数据库和使用pacman的—refresh选项。
SEE ALSO
makepkg is the package-building tool that comes with pacman.
AUTHOR
Judd Vinet <jvinet@zeroflux.org> |