+ -
当前位置:首页 → 问答吧 → pacman命令中文翻译

pacman命令中文翻译

时间:2005-03-14

来源:互联网

因为不怎么好排版,就做个连接了:
http://download.ourlinux.net/archlin...an/pacman.html


pacman Section: (8) Updated: September 17, 2004
翻译者:翟翔 [email protected] 翻译最后更新: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 <[email protected]>

作者: 碧轩   发布时间: 2005-03-14

 哈哈,我写过pacman和makepkg manpage的中文翻译,现在用户多了,干脆我回头把那个发给你吧,你帮忙维护一下。

作者: ganloo   发布时间: 2005-03-14

hoho...发过来吧!

作者: 碧轩   发布时间: 2005-03-14

有没有相当于apt-get -f install的命令呢?

作者: xep007   发布时间: 2005-03-14

-o, --owns <file>

Search for the package that owns <file>.

搜索属于<文件>的包。
-----------------------------------------

这里翻译错了吧。是“搜索包含<文件>的包”。

作者: diony   发布时间: 2005-03-15

发送email失败,现贴在这里:
引用:
.TH makepkg 8 "August 3, 2004" "makepkg 2.9.2" ""

.SH NAME

makepkg \- 软件包创建工具

.SH SYNOPSIS

\fBmakepkg [选项]\fP

.SH DESCRIPTION

\fBmakepkg\fP 会为你创建软件包。它所需要的一切只是

一个符合创建环境的linux平台、wget和一些用于创建的脚本。基于

脚本创建软件包的好处在于你仅仅需要做一次工作。一旦你

已经有一个软件包的创建脚本,你仅需要运行makepkg,剩下的

它会负责完成:下载、验证源代码、检查依赖关系、

配置创建环境、创建软件包、安装软件包

到一个临时的根目录、自定义、产生meta信息、把整个打包好

以供\fBpacman\fP使用。



\fBmakeworld\fP 能用于重建整个的软件包组或者

整个创建树目录。\fBmakeworld --help\fP 查看语法。

.SH 创建过程 (或者叫如何创建你自己的软件包)

在一个单独的目录下开始(也就是说,这个目录仅用于创建这个软件包

而不是其他目的)。创建脚本应当命名为PKGBUILD

而且应当类似下面的例子。



\fB提示:\fP 如果你在本地机器上有一个Arch创建系统(ABS)的目录树,

你可以复制PKGBUILD.proto文件到你新软件包的创建目录中

并在那里进行修改。要获得/同步ABS目录树,使用

包含在pacman/makepkg中的 \fBabs\fP 脚本。



.TP

.TP

.SH PKGBUILD 例子:

.RS

.nf

pkgname=modutils

pkgver=2.4.25

pkgrel=1

pkgdesc="Utilities for inserting and removing modules from the linux kernel"

url="http://www.kernel.org"

backup=(etc/modules.conf)

makedepends=('bash' 'mawk')

depends=('glibc' 'zlib')

source=(ftp://ftp.kernel.org/pub/linux/utils/kernel/$pkgname/v2.4/$pkgname-$pkgver.tar.bz2 \\

modules.conf)

md5sums=('2c0cca3ef6330a187c6ef4fe41ecaa4d' \\

'35175bee593a7cc7d6205584a94d8625')



build() {

cd $startdir/src/$pkgname-$pkgver

./configure --prefix=/usr --enable-insmod-static

make || return 1

make prefix=$startdir/pkg/usr install

mv $startdir/pkg/usr/sbin $startdir/pkg

mkdir -p $startdir/pkg/etc

cp ../modules.conf $startdir/pkg/etc

}

.fi

.RE



如你所见,设置相当的简单。头三行定义了

软件包的名字和版本信息。它们同样定义了最终的软件包名字

名字使用 \fI$pkgname-$pkgver-$pkgrel.pkg.tar.gz\fP 格式。第4行

则提供了软件包的简短描述。每一个PKGBUILD脚本

都应当包含这4行。



\fIbackup=\fP 行指定了当删除或者升级软件包时

应当特殊对待的一些文件。更多信息参见\fIpacman\fP帮助页中

\fB处理配置文件\fP 部分。



第7、8行列出的是该软件包的依赖关系。\fIdepends\fP队列

指明运行时需要的依赖关系,\fImakedepends\fP则指明创建时需要的

依赖关系。要运行软件包,必须满足\fIdepends\fP要求。要

创建该软件包,必须首先满足\fB所有的\fP依赖关系。makepkg

在尝试创建该软件包之前会先进行检查。



\fIsource\fP队列则告诉makepkg在编译开始之前,哪些文件应该先下载并解压

\fImd5sums\fP队列提供了每个文件的md5sums校验码。这个校验码将

用于验证源代码文件的完整性。



一旦你创建好了你的PKGBUILD,你就可以从创建目录中运行\fImakepkg\fP。

然后makepkg将检查依赖关系,寻找创建所需要的源代码文件

如果缺少某些文件,它就会尝试下载这些文件,前提是\fIsource\fP队列

这里有完全符合要求的URL地址。



接着源代码将被解压到命名为./src的下级目录,并

调用\fIbuild\fP函数。所有的软件包配置,

创建和安装均在这里完成。一些自定义也可能

发生在这里。



软件包创建完毕之后,\fIbuild\fP函数必须安装软件包的文件

到一个特殊的软件包根目录,这个根目录将引用\fIbuild\fP函数中

的B$startdir/pkg\fP定义。下面是一个典型的方法:

.RS

.nf



make DESTDIR=$startdir/pkg install



或者



make prefix=$startdir/pkg/usr install



.fi

.RE

注意"/usr"部分应当是"prefix",而不是"DESTDIR",

推荐使用"DESTDIR",但是不是所有的Makefiles都支持它。

请仅仅在"DESTDIR"无效时才使用"prefix"。



一旦软件包成功地安装至软件包根目录,\fImakepkg\fP

会删除一些诸如/usr/doc和/usr/info的目录(按照Arch Linux

软件包指引。如果你在其他地方使用,尽管进行修改)。它会

接着删去库函数和二进制代码的调试信息并产生一份meta信息文件。

最后,它会所有东西压缩为一个.pkg.tar.gz文件,并保留在

你运行\fBmakepkg\fP的目录中。



此时,在当前目录中你应当已经有一个命名为:

软件包名-版本-发布号.pkg.tar.gz之类的软件包文件。搞定!



.SH 安装/升级/删除的脚本

当使用Pacman安装、删除或者升级某个软件包时,

Pacman能够储存并执行软件包指定的脚本。这允许软件包在安装之后

去“配置自身”,同样的,在被删除之前做相反的事情。



The exact time the script is run varies with each operation:

.TP

.B pre_install

在解压文件之前即运行脚本。



.TP

.B post_install

在解压文件之后即运行脚本。



.TP

.B pre_upgrade

在解压文件之前即运行脚本。



.TP

.B post_upgrade

在解压文件之后即运行脚本。



.TP

.B pre_remove

在删除文件之前即运行脚本。



.TP

.B post_remove

在删除文件之后即运行脚本。



.RE

要使用这个功能,仅仅需要创建一个 (比如, pkgname.install)的文件,并放置

包含PKGBUILD教本的同一目录。然后使用\fIinstall\fP指示:

.RS

.nf

install=pkgname.install

.fi

.RE



不需要在\fIsource\fP队列中指定该安装脚本。



.TP

.TP

.SH 安装脚本必须遵循下列格式:

.RS

.nf

# arg 1: the new package version

pre_install() {

#

# 此处为安装前动作

#

/bin/true

}



# arg 1: the new package version

post_install() {

#

# 此处为安装后动作

#

/bin/true

}



# arg 1: the new package version

# arg 2: the old package version

pre_upgrade() {

#

# 此处为升级前动作

#

/bin/true

}



# arg 1: the new package version

# arg 2: the old package version

post_upgrade() {

#

# 此处为升级后动作

#

/bin/true

}



# arg 1: the old package version

pre_remove() {

#

# 此处为删除前动作

#

/bin/true

}



# arg 1: the old package version

post_remove() {

#

# 此处为删除后动作

#

/bin/true

}



op=$1

shift

$op $*

.fi

.RE



这个模版同样可以在你的ABS目录树中找到(/var/abs/install.proto)。



.SH PKGBUILD指示

.TP

.B pkgname

软件包名。因为将用于软件包名的,所以

命名必须是unix友好的

.TP

.B pkgver

该程序作者发布的版本号(比如:2.7.1)。



.TP

.B pkgrel

Arch Linux软件包的发布号。



.TP

.B pkgdesc

该软件包以及其功能的简要描述,



.TP

.B force

用于\fB--sysupgrade\fP时强迫升级软件包,

即便它是更老的版本。



.TP

.B url

软件包中程序相关联的URL地址(可选),

通常是该项目的网站。



.TP

.B license

设置程序许可证类型(如"GPL", "BSD", "NON-FREE")。(\fB注意\fP: 本

选项仍然处于开发中,将来也许会有变化。



.TP

.B install

指定包括在软件包中的安装脚本。

该文件必须与PKGBUILD在同一目录中,并由makepkg

复制进软件包。不需要包含在

\fIsource\fP队列。(如install=modutils.install)



.TP

.B source \fI(array)\fP

\fIsource\fP行是创建软件包需要的源代码文件队列

除非源代码文件有完全合乎要求的URL下载地址,

否则都应当与PKGBUILD在同一目录中。然后如果

在/var/cache/pacman/src中也不存在源代码文件,

wget将下载该文件。



.TP

.B md5sums \fI(队列)\fP

如果存在该字段,它应当为\fIsource\fP队列中指定的每个源代码文件

包含一个MD5 hash(以同样的顺序)。makepkg会在随后的创建过程中

使用它验证源代码文件的完整性。要方便地产生

md5sums校验码,首先使用PKGBUILD创建软件包,然后运行

\fBmakepkg -g >>PKGBILD\fP. 最后编辑PKGBUILD文件,从底部

移动\fImd5sums\fP行至合适的地方即可。



.TP

.B groups \fI(array)\fP

软件包组。This is an array of symbolic names that represent groups of packages,允许

你通过请求一个目标来安装多个软件包。举例说,

你可以通过安装kde组来安装所有属于kde组的软件包。



.TP

.B backup \fI(队列)\fP

以空格分界的文件名队列 (without a preceding slash)。该

\fIbackup\fP行将被复制进软件包的meta信息文件中以供

pacman使用。如果从系统中删除该软件包时,

这将指定所有此处列出的文件都将用备份还原。更多信息

参见\fIpacman\fP帮助页中的\fB处理配置文件\fP。



.TP

.B depends \fI(队列)\fP

本软件包创建和运行时依赖的软件包队列。列出来

的软件包应当放在单括号中,并至少包括

软件包的名字。还可以以\fB软件包名<>版本号\fP格式包括

要求的版本号,这里的<>是指三个比较符号中的一个:\fB>=\fP

(大于等于)。\fB<=\fP (小于等于)。或者\fB=\fP(等于)。

\fIdepends\fP示例可参见上面的PKGBUILD例子。



.TP

.B makedepends \fI(array)\fP

本软件包创建时依赖的软件包队列。(也就是说

非运行时需要的)。列出的软件包应当遵循跟\fIdepends\fP相同的格式。



.TP

.B conflicts \fI(队列)\fP

该列的软件包和本软件包存在冲突。(它们不能

同时安装(。该指示遵循与\fIdepends\fP同样的格式,

除了你不能指定版本号,只能是软件包名。



.TP

.B provides \fI(array)\fP

本软件包提供的“virtual provisions”。这允许一个软件包

提供超过本身软件包名的依赖关系名字。举例说,

kernel-scsi和kernel-ide软件包可以分别提供'kernel'的依赖关系,这使其他的软

件包只需要简单的依赖于'kernel'而不是"kernel-scsi或者kernel-ide或者 ..."



.TP

.B replaces \fI(队列)\fP

本软件包将取代的软件包队列,并能够用于处理

重命名/合并软件包。举个例子,如果kernel软件包重命名为

kernel-ide,那么接下来的'pacman -Syu'调用将不会选择原名字去升级,因为

软件包的名字已经变化。\fIreplaces\fP便处理这种情况。



.SH MAKEPKG选项

.TP

.B "\-b, \-\-builddeps"

Build missing dependencies from source. When makepkg finds missing build-time or

run-time dependencies, it will look for the dependencies' PKGBUILD files under

$ABSROOT (set in your /etc/makepkg.conf). If it finds them it will

run another copy of makepkg to build and install the missing dependencies.

The child makepkg calls will be made with the \fB-b\fP and \fB-i\fP options.

.TP

.B "\-c, \-\-clean"

Clean up leftover work files/directories after a successful build.

.TP

.B "\-C, \-\-cleancache"

Removes all source files from the cache directory to free up diskspace.

.TP

.B "\-d, \-\-nodeps"

Do not perform any dependency checks. This will let you override/ignore any

dependencies required. There's a good chance this option will break the build

process if all of the dependencies aren't installed.

.TP

.B "\-f, \-\-force"

\fBmakepkg\fP will not build a package if a \fIpkgname-pkgver-pkgrel.pkg.tar.gz\fP

file already exists in the build directory. You can override this behaviour with

the \fB--force\fP switch.

.TP

.B "\-g, \-\-genmd5"

Download all source files (if required) and use \fImd5sum\fP to generate md5 hashes

for each of them. You can then redirect the output into your PKGBUILD for source

validation (makepkg -g >>PKGBUILD).

.TP

.B "\-h, \-\-help"

Output syntax and commandline options.

.TP

.B "\-i, \-\-install"

Install/Upgrade the package after a successful build.

.TP

.B "\-j <jobs>"

Sets MAKEFLAGS="-j<jobs>" before building the package. This is useful for overriding

the MAKEFLAGS setting in /etc/makepkg.conf.

.TP

.B "\-m, \-\-nocolor"

Disable color in output messages

.TP

.B "\-n, \-\-nostrip"

Do not strip binaries and libraries.

.TP

.B "\-o, \-\-nobuild"

Download and extract files only, do not build.

.TP

.B "\-p <buildscript>"

Read the package script \fI<buildscript>\fP instead of the default (\fIPKGBUILD\fP).

.TP

.B "\-r, \-\-rmdeps"

Upon successful build, remove any dependencies installed by makepkg/pacman during

dependency auto-resolution (using \fB-b\fP or \fB-s\fP).

.TP

.B "\-s, \-\-syncdeps"

Install missing dependencies using pacman. When makepkg finds missing build-time

or run-time dependencies, it will run pacman to try and resolve them. If successful,

pacman will download the missing packages from a package repository and

install them for you.

.TP

.B "\-w <destdir>"

Write the resulting package file to the directory \fI<destdir>\fP instead of the

current working directory.



.SH CONFIGURATION

Configuration options are stored in \fI/etc/makepkg.conf\fP. This file is parsed

as a bash script, so you can export any special compiler flags you wish

to use. This is helpful for building for different architectures, or with

different optimizations.



\fBNOTE:\fP This does not guarantee that all package Makefiles will use

your exported variables. Some of them are flaky...

.SH SEE ALSO

\fBpacman\fP is the package manager that uses packages built by makepkg.



See the Arch Linux Documentation for package-building guidelines if you wish

to contribute packages to the Arch Linux project.

.SH AUTHOR

.nf

Judd Vinet <[email protected]>

.fi
现在才发现保存在家里硬盘里的是后面部分还没有翻译的以前版本,翻完了的可能放在公司了,哈哈。

作者: ganloo   发布时间: 2005-03-15

-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.

列出没有正确安装的所有包(比如,没有被其他包作为一种依赖),没有被其他的包需求。---这句有问题。explicitly一般翻译成显式。这里就是单独的独立的。不被其他包依赖。
另外哪位知道如何查看所有的可用包?就是包括已装和未装的包?

作者: fei   发布时间: 2005-04-04

直接pacman -Ss。pacman -Sl extra则列出所有extra仓库中的可用包。

作者: diony   发布时间: 2005-04-04

关于那一段explicitly installed,我想如果非要翻译的话,最好翻译成“非间接”,“主动”也可以。“直接”也可以(不易理解,不过准确),“显式”则有些让人费解。

“非间接安装的包(主动安装的包)”和“孤立的包”应该是有交集的两个集合。前者仅从安装方式上判断,后者仅从该包在系统中的依赖关系方面判断。

例如,
假设A依赖B,B依赖C,B、C是组a的成员,则:
pacman -S A,就会装上A,B,C。此时pacman -Qe的结果仅包含A。
pacman -S A B,也会装上A,B,C。但此时pacman -Qe的结果包含A和B。
即pacman -S了什么,pacman -Qe就会显示什么,但对于组:
pacman -S a,则pacman -Qe 的结果显示B和C。

例子可能不太恰当,兄弟们大概看看明白就行了。

都是个人理解,如果有错欢迎指出。

作者: diony   发布时间: 2005-04-04

热门下载

更多