原文:https://wiki.archlinux.org/index.php/Pacman/Rosetta
https://old-en.opensuse.org/Software_Management_Command_Line_Comparison
http://dnf.readthedocs.org/en/latest/cli_vs_yum.html
https://en.wikipedia.org/wiki/Package_manager
ty | co | Action | 行動 | Arch | Red Hat/Fedora | Debian/Ubuntu | SLES/openSUSE | Gentoo | ty |
Basic operations 基本操作 | 1 | Install a package(s) by name | 按名稱安裝軟件包 | pacman -S | dnf install | apt install | zypper install zypper in |
emerge [-a] | Basic operations 基本操作 |
2 | Remove a package(s) by name | 按名稱刪除包 | pacman -Rs | dnf remove | apt remove | zypper remove zypper rm |
emerge -C | ||
3 | Search 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 -Ss | dnf search | apt search | zypper search zypper se [-s] |
emerge -S | ||
4 | Upgrade Packages - Install packages which have an older version already installed | 升級包 - 安裝已安裝舊版本的包 | pacman -Syu | dnf upgrade | apt update && apt upgrade | zypper update zypper up | emerge -u world | ||
5 | Upgrade 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 -Syu | dnf distro-sync | apt update && apt dist-upgrade | zypper dup | emerge -uDN world | ||
6 | Clean up all local caches. Options might limit what is actually cleaned. Autoclean removes only unneeded, obsolete information. | 清理所有本地緩存 。選項可能會限制實際清理的內容。 Autoclean僅刪除不需要的過時信息。 | pacman -Sc pacman -Scc |
dnf clean all | apt autoclean apt clean |
zypper clean | eclean distfiles | ||
7 | Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed. | 刪除不再需要的依賴項,例如刪除了需要依賴項的包。 | pacman -Qdtq | pacman -Rs - | dnf autoremove | apt autoremove | zypper rm -u | emerge --depclean | ||
8 | Remove packages no longer included in any repositories. | 刪除不再包含在任何存儲庫中的包。 | pacman -Qmq | pacman -Rs - | dnf repoquery --extras | aptitude purge '~o' | ||||
9 | Mark a package previously installed as a dependency as explicitly required. | 將先前作為依賴項安裝的包標記為明確要求。 | pacman -D --asexplicit | dnf mark install | apt-mark manual | emerge --select | |||
10 | Install package(s) as dependency / without marking as explicitly required. | 安裝包作為依賴/沒有明確要求的標記。 | pacman -S --asdeps | dnf install => dnf mark remove | apt-mark auto | emerge -1 | |||
11 | Only downloads the given package(s) without unpacking or installing them | 僅下載給定的軟件包而無需解壓縮或安裝它們 | pacman -Sw | dnf download | apt install --download-only (into the package cache) apt download (bypass the package cache) |
zypper --download-only | emerge --fetchonly | ||
12 | Start a shell to enter multiple commands in one session | 啟動shell以在一個會話中輸入多個命令 | apt-config shell | zypper shell | |||||
13 | Show a log of actions taken by the software management. | 顯示軟件管理所采取的操作的日志。 | cat /var/log/pacman.log | dnf history | cat /var/log/dpkg.log | cat /var/log/zypp/history | located in /var/log/portage | ||
14 | Get 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 stats | n/a | emerge --info | ||
15 | e-mail delivery of package changes | 電子郵件傳遞包更改 | apt install apt-listchanges | ||||||
Querying specific packages 查詢特定包 | 1 | Show 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]i | dnf list, dnf info | apt show / apt-cache policy | zypper info zypper if | emerge -S; emerge -pv; eix | Querying specific packages 查詢特定包 |
2 | Display local package information: Name, version, description, etc. | 顯示本地包信息:名稱,版本,描述等。 | pacman -Qi | rpm -qi / dnf info installed | dpkg -s / aptitude show | zypper info; rpm -qi | emerge -pv and emerge -S | ||
3 | Display remote package information: Name, version, description, etc. | 顯示遠程包信息:名稱,版本,描述等。 | pacman -Si | dnf info | apt-cache show / aptitude show | zypper info | emerge -pv and emerge -S or equery m (meta) | ||
4 | Display files provided by local package | 顯示本地包提供的文件 | pacman -Ql | rpm -ql | dpkg -L | rpm -Ql | equery files | ||
5 | Display files provided by a remote package | 顯示遠程包提供的文件 | pacman -Fl | dnf repoquery -l or repoquery -l (from package yum-utils) | apt-file list $pattern | pfl | |||
6 | Query the package which provides FILE | 查詢提供FILE的包 | pacman -Qo | rpm -qf (installed only) or dnf provides (everything) or repoquery -f (from package yum-utils) | dpkg -S / dlocate | zypper search -f | equery belongs | ||
7 | List the files that the package holds. Again, this functionality can be mimicked by other more complex commands. | 列出程序包包含的文件。 同樣,此功能可以通過其他更復雜的命令來模仿。 | pacman -Ql pacman -Fl |
dnf repoquery -l | dpkg-query -L | rpm -ql | equery files | ||
8 | Displays 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 -Fo | dnf provides | apt-file search | zypper what-provides zypper wp | equery belongs (only installed packages); pfl | ||
9 | Search all packages to find the one which holds the specified file. auto-apt is using this functionality. | 搜索所有包以查找包含指定文件的包。 auto-apt正在使用此功能。 | pacman -Fs | dnf provides | apt-file search | zypper search -f | equery belongs | ||
10 | Show the changelog of a package | 顯示包的更改日志 | pacman -Qc | rpm -q --changelog | apt-get changelog | rpm -q --changelog | equery changes -f | ||
Querying package lists 查詢包列表 | 1 | Search 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 -Ss | dnf search | apt search | zypper search zypper se [-s] | emerge -S | Querying package lists 查詢包列表 |
2 | Lists packages which have an update available. Note: Some provide special commands to limit the output to certain installation sources, others use options. | 列出具有可用更新的包。注意:有些命令提供特殊命令來限制輸出到某些安裝源,其他命令則使用選項。 | pacman -Qu | dnf list updates, dnf check-update | apt-get upgrade -> n | zypper list-updates zypper patch-check (just for patches) | emerge -uDNp world | ||
3 | Display 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 -Sl | dnf list available | apt-cache dumpavail apt-cache dump (Cache only) apt-cache pkgnames | zypper packages | emerge -ep world | ||
4 | Generates a list of installed packages | 生成已安裝包的列表 | pacman -Q | dnf list installed | dpkg --list | grep ^i | zypper search --installed-only | emerge -ep world | ||
5 | List packages that are installed but are not available in any installation source (anymore). | 列出已安裝但在任何安裝源(不再)中都不可用的軟件包。 | pacman -Qm | dnf list extras | deborphan | zypper se -si | grep 'System Packages' | eix-test-obsolete | ||
6 | List packages that were recently added to one of the installation sources, i.e. which are new to it. | 列出最近添加到其中一個安裝源的軟件包,即新的安裝源。 | (none) | dnf list recent | aptitude search '~N' / aptitude forget-new | n/a | eix-diff | ||
7 | List installed local packages along with version | 列出已安裝的本地軟件包以及版本 | pacman -Q | rpm -qa | dpkg -l | zypper search -s; rpm -qa | emerge -e world | ||
8 | Search locally installed package for names or descriptions | 在本地安裝的包中搜索名稱或描述 | pacman -Qs | rpm -qa '*<str>*' | aptitude search '~i(~n $name|~d $description)' | eix -S -I | |||
9 | List packages not required by any other package | 列出任何其他包不需要的包 | pacman -Qt | package-cleanup --all --leaves | deborphan -anp1 | ||||
10 | List packages installed explicitly (not as dependencies) | 列出明確安裝的包(不是依賴項) | pacman -Qe | dnf history userinstalled | apt-mark showmanual | ||||
11 | List packages installed automatically (as dependencies) | 列出自動安裝的包(作為依賴項) | pacman -Qd | apt-mark showauto | |||||
Querying package dependencies 查詢包依賴項 | 1 | Display packages which require X to be installed, aka show reverse dependencies. | 顯示需要安裝X的軟件包,也就是顯示反向依賴項。 | pacman -Sii | dnf repoquery --alldeps --whatrequires or repoquery --whatr[equires] | apt-cache rdepends / aptitude search ~D$pattern | zypper search --requires | equery depends | Querying package dependencies 查詢包依賴項 |
2 | Display packages which conflict with given expression (often package). Search can be used as well to mimic this function. | 顯示與給定表達式(通常是包)沖突的包。 也可以使用搜索來模仿此功能。 | dnf repoquery --conflicts | aptitude search '~C$pattern' | |||||
3 | List all packages which are required for the given package, aka show dependencies. | 列出給定包所需的所有包,即show dependencies。 | pacman -[S|Q]i | dnf repoquery --requires or repoquery -R | apt-cache depends / apt-cache show | zypper info --requires | emerge -ep | ||
4 | List what the current package provides | 列出當前包提供的內容 | dnf provides | dpkg -s / aptitude show | zypper info --provides | equery files | |||
5 | List all packages that require a particular package | 列出需要特定包的所有包 | dnf repoquery --alldeps --whatrequires | aptitude search ~D{depends,recommends,suggests}:$pattern / aptitude why | zypper search --requires | equery depends -a | |||
6 | Display all packages that the specified packages obsoletes. | 顯示指定包廢棄的所有包。 | dnf list obsoletes | apt-cache show | |||||
7 | Generates an output suitable for processing with dotty for the given package(s). | 生成適合於使用dotty處理給定包的輸出。 | apt-cache dotty | n/a | |||||
Installation sources management 安裝源管理 | 1 | Installation sources management | 安裝源管理 | ${EDITOR} /etc/pacman.conf | ${EDITOR} /etc/yum.repos.d/${REPO}.repo | ${EDITOR} /etc/apt/sources.list | ${EDITOR} /etc/zypp/repos.d/${REPO}.repo | layman | Installation sources management 安裝源管理 |
2 | Add 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/*.repo | apt-cdrom add | zypper service-add | layman, overlays | ||
3 | Refresh 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-update | apt-get update | zypper refresh zypper ref | emerge --sync;layman -S | ||
4 | Prints a list of all installation sources including important information like URI, alias etc. | 打印所有安裝源的列表,包括URI,別名等重要信息。 | cat /etc/pacman.d/mirrorlist | cat /etc/yum.repos.d/* | apt-cache policy | zypper service-list | layman -l | ||
5 | List all packages from a certain repo | 列出某個倉庫中的所有包裹 | paclist <repo> | ||||||
6 | Disable an installation source for an operation | 禁用操作的安裝源 | dnf --disablerepo= | emerge package::repo-to-use | |||||
7 | Download 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 覆蓋 | 1 | Add 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 pkg | Put package name in /etc/zypp/locks, or zypper al | /etc/portage/package.mask | Overrides 覆蓋 |
2 | Delete a package lock rule | 刪除包鎖定規則 | remove package from IgnorePkg line in /etc/pacman.conf | apt-mark unhold pkg | Remove package name from /etc/zypp/locks or zypper rl | /etc/portage/package.mask (or package.unmask) | |||
3 | Show a listing of all lock rules | 顯示所有鎖定規則的列表 | cat /etc/pacman.conf | /etc/apt/preferences | View /etc/zypp/locks or zypper ll | cat /etc/portage/package.mask | |||
4 | Set 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 policy | zypper mr -p | ${EDITOR} /etc/portage/package.keywords Add a line with =category/package-version |
|||
5 | Remove a previously set priority | 刪除先前設置的優先級 | /etc/apt/preferences | zypper mr -p | ${EDITOR} /etc/portage/package.keywords remove offending line |
||||
6 | Show a list of set priorities. | 顯示設置優先級列表。 | apt-cache policy /etc/apt/preferences | zypper lr -p | cat /etc/portage/package.keywords | ||||
7 | Ignores problems that priorities may trigger. | 忽略優先級可能觸發的問題。 | n/a | ||||||
Verification and repair 驗證和修復 | 1 | Verify single package | 驗證單個包 | pacman -Qk[k] | rpm -V | debsums | rpm -V | equery check | Verification and repair 驗證和修復 |
2 | Verify all packages | 驗證所有包 | pacman -Qk[k] | rpm -Va | debsums | rpm -Va | equery check | ||
3 | Reinstall given Package - Will reinstall the given package without dependency hassle. | 重新安裝給定的包 - 將重新安裝給定的包沒有依賴性麻煩。 | pacman -S | dnf reinstall | apt install --reinstall | zypper install --force | emerge -1O | ||
4 | Verify dependencies of the complete system. Used if installation process was forcefully killed. | 驗證整個系統的依賴關系。 如果強制終止安裝過程,則使用。 | pacman -Dk | dnf repoquery --requires | apt-get check | zypper verify | emerge -uDN world | ||
5 | Use some magic to fix broken dependencies in a system | 使用一些魔法來修復系統中破壞的依賴項 | pacman dep level - pacman -Dk, shared lib level - findbrokenpkgs or lddd | dnf repoquery --unsatisfied | apt-get --fix-broken aptitude install |
zypper verify | revdep-rebuild | ||
6 | Add a checkpoint to the package system for later rollback | 將檢查點添加到包系統以便以后回滾 | (unnecessary, done on every transaction) | n/a | |||||
7 | Remove a checkpoint from the system | 從系統中刪除檢查點 | N/A | N/A | n/a | ||||
8 | Provide a list of all system checkpoints | 提供所有系統檢查點的列表 | N/A | dnf history list | n/a | ||||
9 | Rolls entire packages back to a certain date or checkpoint. | 將整個包裹卷回特定日期或檢查點。 | N/A | dnf history rollback | n/a | ||||
10 | Undo a single specified transaction. | 撤消單個指定的事務。 | N/A | dnf history undo | n/a | ||||
Using package files and building packages 使用包文件和構建包 | 1 | Query a package supplied on the command line rather than an entry in the package management database | 查詢命令行上提供的包而不是包管理數據庫中的條目 | pacman -Qp | rpm -qp | dpkg -I | Using package files and building packages 使用包文件和構建包 | ||
2 | List the contents of a package file | 列出包文件的內容 | pacman -Qpl | rpmls rpm -qpl | dpkg -c | rpm -qpl | |||
3 | Installs local package file, e.g. app.rpm and uses the installation sources to resolve dependencies | 安裝本地包文件,例如 app.rpm並使用安裝源來解決依賴關系 | pacman -U | dnf install | apt install | zypper in | emerge | ||
4 | Updates package(s) with local packages and uses the installation sources to resolve dependencies | 使用本地軟件包更新軟件包,並使用安裝源來解決依賴關系 | pacman -U | dnf upgrade | debi | emerge | |||
5 | Add a local package to the local package cache mostly for debugging purposes. | 將本地程序包添加到本地程序包高速緩存主要用於調試目的。 | cp $filename /var/cache/pacman/pkg/ | apt-cache add | n/a | cp $filename /usr/portage/distfiles | |||
6 | Extract a package | 提取包 | tar -Jxvf | rpm2cpio | cpio -vid | dpkg-deb -x | rpm2cpio | cpio -vid | tar -jxvf | ||
7 | Install/Remove packages to satisfy build-dependencies. Uses information in the source package. | 安裝/刪除包以滿足構建依賴性。 使用源包中的信息。 | automatic | dnf builddep | apt-get build-dep | zypper si -d | emerge -o | ||
8 | Display the source package to the given package name(s) | 將源包顯示給給定的包名稱 | dnf repoquery -s | apt-cache showsrc | n/a | ||||
9 | Downloads the corresponding source package(s) to the given package name(s) | 將相應的源包下載到給定的包名稱 | Use ABS && makepkg -o | dnf download --source | apt-get source / debcheckout | zypper source-install | emerge --fetchonly | ||
10 | Build a package | 構建一個包 | makepkg -s | rpmbuild -ba (normal) mock (in chroot) |
debuild | rpmbuild -ba; build; osc build | ebuild; quickpkg | ||
11 | Check for possible packaging issues | 檢查可能的包裝問題 | namcap | rpmlint | lintian | rpmlint | repoman |
Action | zypper[10] | pacman | apt | dnf (yum) | portage |
---|---|---|---|---|---|
install package | zypper in PKG |
pacman -S PACKAGE |
apt install PACKAGE |
yum install PACKAGE |
emerge PACKAGE |
remove package | zypper rm -RU PKG |
pacman -R PACKAGE |
apt remove PACKAGE |
dnf remove --nodeps PACKAGE |
emerge -C PACKAGE or emerge --unmerge PACKAGE |
remove package+orphans | zypper rm -u --force-resolution PKG |
pacman -Rs PACKAGE |
apt autoremove PACKAGE |
dnf remove PACKAGE |
emerge -c PACKAGE or emerge --depclean PACKAGE |
update software database | zypper ref |
pacman -Sy |
apt update |
yum check-update |
emerge --sync |
show updatable packages | zypper lu |
pacman -Qu |
apt list --upgradable |
yum check-update |
emerge -avtuDN --with-bdeps=y @world or emerge --update --pretend @world |
delete orphans+config | zypper rm -u |
pacman -Rsn $(pacman -Qdtq) |
apt autoremove |
dnf erase PKG |
emerge --depclean |
show orphans | zypper pa --orphaned --unneeded |
pacman -Qdt |
package-cleanup --quiet --leaves --exclude-bin |
emerge -caD or emerge --depclean --pretend |
|
update all | zypper up |
pacman -Syu |
apt upgrade |
yum update |
emerge --update --deep --with-bdeps=y @world |