Arch Linux pacman 与其他发行版操作比较

Actionzypper[10]pacmanaptdnf (yum)portage
install packagezypper in PKGpacman -S PACKAGEapt install PACKAGEyum install PACKAGEemerge PACKAGE
remove packagezypper rm -RU PKGpacman -R PACKAGEapt remove PACKAGEdnf remove --nodeps PACKAGEemerge -C PACKAGE or 
emerge --unmerge PACKAGE
remove package+orphanszypper rm -u --force-resolution PKGpacman -Rs PACKAGEapt autoremove PACKAGEdnf remove PACKAGEemerge -c PACKAGE or 
emerge --depclean PACKAGE
update software databasezypper refpacman -Syapt updateyum check-updateemerge --sync
show updatable packageszypper lupacman -Quapt list --upgradableyum check-updateemerge -avtuDN --with-bdeps=y @world or 
emerge --update --pretend @world
delete orphans+configzypper rm -upacman -Rsn $(pacman -Qdtq)apt autoremovednf erase PKGemerge --depclean
show orphanszypper pa --orphaned --unneededpacman -Qdtpackage-cleanup --quiet --leaves --exclude-binemerge -caD or 
emerge --depclean --pretend
update allzypper uppacman -Syuapt upgradeyum updateemerge --update --deep --with-bdeps=y @world
tycoAction行动ArchRed Hat/FedoraDebian/UbuntuSLES/openSUSEGentooty
Basic operations 基本操作1Install a package(s) by name按名称安装软件包pacman -Sdnf installapt installzypper install
zypper in
emerge [-a]Basic operations 基本操作
2Remove a package(s) by name按名称删除包pacman -Rsdnf removeapt removezypper remove
zypper rm
emerge -C
3Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par.通过在名称,描述,简短描述中搜索表达式来搜索包。默认搜索的确切字段在每个工具中都有所不同。大多数选项带来了相同的工具。pacman -Ssdnf searchapt searchzypper search
zypper se [-s]
emerge -S
4Upgrade Packages – Install packages which have an older version already installed升级包 – 安装已安装旧版本的包pacman -Syudnf upgradeapt update && apt upgradezypper update zypper upemerge -u world
5Upgrade Packages – Another form of the update command, which can perform more complex updates — like distribution upgrades. When the usual update command will omit package updates, which include changes in dependencies, this command can perform those updates.升级包 – 另一种形式的更新命令,可以执行更复杂的更新 – 例如分发升级。当通常的更新命令将省略包更新(包括依赖关系的更改)时,此命令可以执行这些更新。pacman -Syudnf distro-syncapt update && apt dist-upgradezypper dupemerge -uDN world
6Clean up all local caches. Options might limit what is actually cleaned. Autoclean removes only unneeded, obsolete information.清理所有本地缓存 。选项可能会限制实际清理的内容。 Autoclean仅删除不需要的过时信息。pacman -Sc
pacman -Scc
dnf clean allapt autoclean
apt clean
zypper cleaneclean distfiles
7Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed.删除不再需要的依赖项,例如删除了需要依赖项的包。pacman -Qdtq | pacman -Rs –dnf autoremoveapt autoremovezypper rm -uemerge –depclean
8Remove packages no longer included in any repositories.删除不再包含在任何存储库中的包。pacman -Qmq | pacman -Rs –dnf repoquery –extrasaptitude purge ‘~o’
9Mark a package previously installed as a dependency as explicitly required.将先前作为依赖项安装的包标记为明确要求。pacman -D –asexplicitdnf mark installapt-mark manualemerge –select
10Install package(s) as dependency / without marking as explicitly required.安装包作为依赖/没有明确要求的标记。pacman -S –asdepsdnf install => dnf mark removeapt-mark autoemerge -1
11Only downloads the given package(s) without unpacking or installing them仅下载给定的软件包而无需解压缩或安装它们pacman -Swdnf downloadapt install –download-only (into the package cache)
apt download (bypass the package cache)
zypper –download-onlyemerge –fetchonly
12Start a shell to enter multiple commands in one session启动shell以在一个会话中输入多个命令apt-config shellzypper shell
13Show a log of actions taken by the software management.显示软件管理所采取的操作的日志。cat /var/log/pacman.logdnf historycat /var/log/dpkg.logcat /var/log/zypp/historylocated in /var/log/portage
14Get a dump of the whole system information – Prints, Saves or similar the current state of the package management system. Preferred output is text or XML. (Note: Why either-or here? No tool offers the option to choose the output format.)获取整个系统信息的转储 – 打印,保存或类似包管理系统的当前状态。首选输出是文本或XML。 (注意:为什么或者在这里?没有工具提供选择输出格式的选项。)(see /var/lib/pacman/local)(see /var/lib/rpm/Packages)apt-cache statsn/aemerge –info
15e-mail delivery of package changes电子邮件传递包更改apt install apt-listchanges
Querying specific packages 查询特定包1Show all or most information about a package. The tools’ verbosity for the default command vary. But with options, the tools are on par with each other.显示有关包的所有或大部分信息。 工具对默认命令的详细程度各不相同。 但是通过选项,这些工具彼此相同。pacman -[S|Q]idnf list, dnf infoapt show / apt-cache policyzypper info zypper ifemerge -S; emerge -pv; eixQuerying specific packages 查询特定包
2Display local package information: Name, version, description, etc.显示本地包信息:名称,版本,描述等。pacman -Qirpm -qi / dnf info installeddpkg -s / aptitude showzypper info; rpm -qiemerge -pv and emerge -S
3Display remote package information: Name, version, description, etc.显示远程包信息:名称,版本,描述等。pacman -Sidnf infoapt-cache show / aptitude showzypper infoemerge -pv and emerge -S or equery m (meta)
4Display files provided by local package显示本地包提供的文件pacman -Qlrpm -qldpkg -Lrpm -Qlequery files
5Display files provided by a remote package显示远程包提供的文件pacman -Fldnf repoquery -l or repoquery -l (from package yum-utils)apt-file list $patternpfl
6Query the package which provides FILE查询提供FILE的包pacman -Qorpm -qf (installed only) or dnf provides (everything) or repoquery -f (from package yum-utils)dpkg -S / dlocatezypper search -fequery belongs
7List the files that the package holds. Again, this functionality can be mimicked by other more complex commands.列出程序包包含的文件。 同样,此功能可以通过其他更复杂的命令来模仿。pacman -Ql 
pacman -Fl
dnf repoquery -ldpkg-query -Lrpm -qlequery files
8Displays packages which provide the given exp. aka reverse provides. Mainly a shortcut to search a specific field. Other tools might offer this functionality through the search command.显示提供给定exp的包。 又名反向提供。 主要是搜索特定字段的快捷方式。 其他工具可能通过搜索命令提供此功能。pacman -Fodnf providesapt-file searchzypper what-provides zypper wpequery belongs (only installed packages); pfl
9Search all packages to find the one which holds the specified file. auto-apt is using this functionality.搜索所有包以查找包含指定文件的包。 auto-apt正在使用此功能。pacman -Fsdnf providesapt-file searchzypper search -fequery belongs
10Show the changelog of a package显示包的更改日志pacman -Qcrpm -q –changelogapt-get changelogrpm -q –changelogequery changes -f
Querying package lists 查询包列表1Search for package(s) by searching the expression in name, description, short description. What exact fields are being searched by default varies in each tool. Mostly options bring tools on par.通过在名称,描述,简短描述中搜索表达式来搜索包。默认搜索的确切字段在每个工具中都有所不同。大多数选项带来了相同的工具。pacman -Ssdnf searchapt searchzypper search zypper se [-s]emerge -SQuerying package lists 查询包列表
2Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options.列出具有可用更新的包。注意:有些命令提供特殊命令来限制输出到某些安装源,其他命令则使用选项。pacman -Qudnf list updates, dnf check-updateapt-get upgrade -> nzypper list-updates zypper patch-check (just for patches)emerge -uDNp world
3Display a list of all packages in all installation sources that are handled by the packages management. Some tools provide options or additional commands to limit the output to a specific installation source.显示由包管理处理的所有安装源中的所有包的列表。某些工具提供选项或其他命令以限制输出到特定安装源。pacman -Sldnf list availableapt-cache dumpavail apt-cache dump (Cache only) apt-cache pkgnameszypper packagesemerge -ep world
4Generates a list of installed packages生成已安装包的列表pacman -Qdnf list installeddpkg –list | grep ^izypper search –installed-onlyemerge -ep world
5List packages that are installed but are not available in any installation source (anymore).列出已安装但在任何安装源(不再)中都不可用的软件包。pacman -Qmdnf list extrasdeborphanzypper se -si | grep ‘System Packages’eix-test-obsolete
6List packages that were recently added to one of the installation sources, i.e. which are new to it.列出最近添加到其中一个安装源的软件包,即新的安装源。(none)dnf list recentaptitude search ‘~N’ / aptitude forget-newn/aeix-diff
7List installed local packages along with version列出已安装的本地软件包以及版本pacman -Qrpm -qadpkg -lzypper search -s; rpm -qaemerge -e world
8Search locally installed package for names or descriptions在本地安装的包中搜索名称或描述pacman -Qsrpm -qa ‘*<str>*’aptitude search ‘~i(~n $name|~d $description)’eix -S -I
9List packages not required by any other package列出任何其他包不需要的包pacman -Qtpackage-cleanup –all –leavesdeborphan -anp1
10List packages installed explicitly (not as dependencies)列出明确安装的包(不是依赖项)pacman -Qednf history userinstalledapt-mark showmanual
11List packages installed automatically (as dependencies)列出自动安装的包(作为依赖项)pacman -Qdapt-mark showauto
Querying package dependencies 查询包依赖项1Display packages which require X to be installed, aka show reverse dependencies.显示需要安装X的软件包,也就是显示反向依赖项。pacman -Siidnf repoquery –alldeps –whatrequires or repoquery –whatr[equires]apt-cache rdepends / aptitude search ~D$patternzypper search –requiresequery dependsQuerying package dependencies 查询包依赖项
2Display packages which conflict with given expression (often package). Search can be used as well to mimic this function.显示与给定表达式(通常是包)冲突的包。 也可以使用搜索来模仿此功能。dnf repoquery –conflictsaptitude search ‘~C$pattern’
3List all packages which are required for the given package, aka show dependencies.列出给定包所需的所有包,即show dependencies。pacman -[S|Q]idnf repoquery –requires or repoquery -Rapt-cache depends / apt-cache showzypper info –requiresemerge -ep
4List what the current package provides列出当前包提供的内容dnf providesdpkg -s / aptitude showzypper info –providesequery files
5List all packages that require a particular package列出需要特定包的所有包dnf repoquery –alldeps –whatrequiresaptitude search ~D{depends,recommends,suggests}:$pattern / aptitude whyzypper search –requiresequery depends -a
6Display all packages that the specified packages obsoletes.显示指定包废弃的所有包。dnf list obsoletesapt-cache show
7Generates an output suitable for processing with dotty for the given package(s).生成适合于使用dotty处理给定包的输出。apt-cache dottyn/a
Installation sources management 安装源管理1Installation sources management安装源管理${EDITOR} /etc/pacman.conf${EDITOR} /etc/yum.repos.d/${REPO}.repo${EDITOR} /etc/apt/sources.list${EDITOR} /etc/zypp/repos.d/${REPO}.repolaymanInstallation sources management 安装源管理
2Add an installation source to the system. Some tools provide additional commands for certain sources, others allow all types of source URI for the add command. Again others, like apt and dnf force editing a sources list. apt-cdrom is a special command, which offers special options design for CDs/DVDs as source.将安装源添加到系统。 某些工具为某些源提供附加命令,其他工具允许add命令的所有类型的源URI。 其他人,比如apt和dnf强制编辑源列表。 apt-cdrom是一个特殊的命令,它提供CD / DVD的特殊选项设计作为源。/etc/pacman.conf/etc/yum.repos.d/*.repoapt-cdrom addzypper service-addlayman, overlays
3Refresh the information about the specified installation source(s) or all installation sources.刷新有关指定安装源或所有安装源的信息。pacman -Sy (always upgrade the whole system afterwards)dnf clean expire-cache && dnf check-updateapt-get updatezypper refresh zypper refemerge –sync;layman -S
4Prints a list of all installation sources including important information like URI, alias etc.打印所有安装源的列表,包括URI,别名等重要信息。cat /etc/pacman.d/mirrorlistcat /etc/yum.repos.d/*apt-cache policyzypper service-listlayman -l
5List all packages from a certain repo列出某个仓库中的所有包裹paclist <repo>
6Disable an installation source for an operation禁用操作的安装源dnf –disablerepo=emerge package::repo-to-use
7Download packages from a different version of the distribution than the one installed.从分发版本的不同版本下载软件包。dnf –releasever=apt-get install -t release package/ apt-get install package/release (deps not covered)echo “category/package ~amd64” >> /etc/portage/package.keywords && emerge package
Overrides 覆盖1Add a package lock rule to keep its current state from being changed添加程序包锁定规则以防止其当前状态发生更改/etc/pacman.conf
modify IgnorePkg array
dnf.conf <–”exclude” option (add/amend)apt-mark hold pkgPut package name in /etc/zypp/locks, or zypper al/etc/portage/package.maskOverrides 覆盖
2Delete a package lock rule删除包锁定规则remove package from IgnorePkg line in /etc/pacman.confapt-mark unhold pkgRemove package name from /etc/zypp/locks or zypper rl/etc/portage/package.mask (or package.unmask)
3Show a listing of all lock rules显示所有锁定规则的列表cat /etc/pacman.conf/etc/apt/preferencesView /etc/zypp/locks or zypper llcat /etc/portage/package.mask
4Set the priority of the given package to avoid upgrade, force downgrade or to overwrite any default behavior. Can also be used to prefer a package version from a certain installation source.设置给定包的优先级以避免升级,强制降级或覆盖任何默认行为。 也可用于优先选择某个安装源的软件包版本。${EDITOR} /etc/pacman.conf
Modify HoldPkg and/or IgnorePkg arrays
/etc/apt/preferences, apt-cache policyzypper mr -p${EDITOR} /etc/portage/package.keywords
Add a line with =category/package-version
5Remove a previously set priority删除先前设置的优先级/etc/apt/preferenceszypper mr -p${EDITOR} /etc/portage/package.keywords
remove offending line
6Show a list of set priorities.显示设置优先级列表。apt-cache policy /etc/apt/preferenceszypper lr -pcat /etc/portage/package.keywords
7Ignores problems that priorities may trigger.忽略优先级可能触发的问题。n/a
Verification and repair 验证和修复1Verify single package验证单个包pacman -Qk[k]rpm -Vdebsumsrpm -Vequery checkVerification and repair 验证和修复
2Verify all packages验证所有包pacman -Qk[k]rpm -Vadebsumsrpm -Vaequery check
3Reinstall given Package – Will reinstall the given package without dependency hassle.重新安装给定的包 – 将重新安装给定的包没有依赖性麻烦。pacman -Sdnf reinstallapt install –reinstallzypper install –forceemerge -1O
4Verify dependencies of the complete system. Used if installation process was forcefully killed.验证整个系统的依赖关系。 如果强制终止安装过程,则使用。pacman -Dkdnf repoquery –requiresapt-get checkzypper verifyemerge -uDN world
5Use some magic to fix broken dependencies in a system使用一些魔法来修复系统中破坏的依赖项pacman dep level – pacman -Dk, shared lib level – findbrokenpkgs or lddddnf repoquery –unsatisfiedapt-get –fix-broken
aptitude install
zypper verifyrevdep-rebuild
6Add a checkpoint to the package system for later rollback将检查点添加到包系统以便以后回滚(unnecessary, done on every transaction)n/a
7Remove a checkpoint from the system从系统中删除检查点N/AN/An/a
8Provide a list of all system checkpoints提供所有系统检查点的列表N/Adnf history listn/a
9Rolls entire packages back to a certain date or checkpoint.将整个包裹卷回特定日期或检查点。N/Adnf history rollbackn/a
10Undo a single specified transaction.撤消单个指定的事务。N/Adnf history undon/a
Using package files and building packages 使用包文件和构建包1Query a package supplied on the command line rather than an entry in the package management database查询命令行上提供的包而不是包管理数据库中的条目pacman -Qprpm -qpdpkg -IUsing package files and building packages 使用包文件和构建包
2List the contents of a package file列出包文件的内容pacman -Qplrpmls rpm -qpldpkg -crpm -qpl
3Installs local package file, e.g. app.rpm and uses the installation sources to resolve dependencies安装本地包文件,例如 app.rpm并使用安装源来解决依赖关系pacman -Udnf installapt installzypper inemerge
4Updates package(s) with local packages and uses the installation sources to resolve dependencies使用本地软件包更新软件包,并使用安装源来解决依赖关系pacman -Udnf upgradedebiemerge
5Add a local package to the local package cache mostly for debugging purposes.将本地程序包添加到本地程序包高速缓存主要用于调试目的。cp $filename /var/cache/pacman/pkg/apt-cache addn/acp $filename /usr/portage/distfiles
6Extract a package提取包tar -Jxvfrpm2cpio | cpio -viddpkg-deb -xrpm2cpio | cpio -vidtar -jxvf
7Install/Remove packages to satisfy build-dependencies. Uses information in the source package.安装/删除包以满足构建依赖性。 使用源包中的信息。automaticdnf builddepapt-get build-depzypper si -demerge -o
8Display the source package to the given package name(s)将源包显示给给定的包名称dnf repoquery -sapt-cache showsrcn/a
9Downloads the corresponding source package(s) to the given package name(s)将相应的源包下载到给定的包名称Use ABS && makepkg -odnf download –sourceapt-get source / debcheckoutzypper source-installemerge –fetchonly
10Build a package构建一个包makepkg -srpmbuild -ba (normal)
mock (in chroot)
debuildrpmbuild -ba; build; osc buildebuild; quickpkg
11Check for possible packaging issues检查可能的包装问题namcaprpmlintlintianrpmlintrepoman

发表评论

邮箱地址不会被公开。 必填项已用*标注