pacman.cheat 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. % pacman compares with apt, ArchLinux
  2. # Install a package(s) by name, equal to `apt install <pkg_name>`
  3. sudo pacman -S <pkg_name>
  4. # Remove a package(s) by name, equal to `apt remove <pkg_name>`
  5. sudo pacman -Rs <pkg_name_installed>
  6. # Search for package(s), equal to `apt search <keyword>`
  7. sudo pacman -Ss <keyword>
  8. # Upgrade Packages, equal to `apt update` and then `apt upgrade <pkg_name>`
  9. sudo pacman -Syu <pkg_name>
  10. # Clean up all local caches, equal to `apt autoclean` or `apt clean`
  11. sudo pacman -Sc
  12. # Clean up all local caches, equal to `apt autoclean` or `apt clean`
  13. sudo pacman -Scc
  14. # Remove dependencies that are no longer needed, equal to `apt autoremove`
  15. sudo pacman -Qdtq | pacman -Rs -
  16. # Remove packages no longer included in any repositories, equal to `aptitude purge ~o`
  17. sudo pacman -Qmq | pacman -Rs -
  18. # Mark a package previously installed as a dependency as explicitly required, equal to `apt-mark manual <pkg_name>`
  19. sudo pacman -D --asexplicit <pkg_name>
  20. # Install package(s) as dependency / without marking as explicitly required, equal to `apt-mark auto <pkg_name>`
  21. sudo pacman -S --asdeps <pkg_name>
  22. # Only downloads the given package(s) without unpacking or installing them, equal to `apt install --download-only <pkg_name>` or `apt download <pkg_name>`
  23. sudo pacman -Sw <pkg_name>
  24. # Show a log of actions taken by the software management, equal to `less /var/log/dpkg.log`
  25. sudo less /var/log/pacman.log
  26. # Get a dump of the whole system information, equal to `apt-cache stats`
  27. sudo less /var/lib/pacman/local
  28. # Show all or most information about a package, equal to `apt show <pkg_name>` or `apt-cache policy <pkg_name>`
  29. sudo pacman -Si <pkg_name>
  30. # Show all or most information about a package, equal to `apt show <pkg_name>` or `apt-cache policy <pkg_name>`
  31. sudo pacman -Qi <pkg_name>
  32. # Display local package information, equal to `dpkg -s <pkg_name>` or `aptitude show <pkg_name>`
  33. sudo pacman -Qi <pkg_name>
  34. # Display remote package information, equal to `apt-cache show <pkg_name>` or `aptitude show <pkg_name>`
  35. sudo pacman -Si <pkg_name>
  36. # Display files provided by local package, equal to `dpkg -L <pkg_name>`
  37. sudo pacman -Ql <pkg_name>
  38. # Display files provided by a remote package, equal to `apt-file list <pkg_name>`
  39. sudo pacman -Fl <pkg_name>
  40. # Query the package which provides file, equal to `dpkg -S <file_name>` or `dlocate <file_name>`
  41. sudo pacman -Qo <file_name>
  42. # List the files that the package holds, equal to `dpkg-query -L <pkg_name>`
  43. sudo pacman -Ql <pkg_name>
  44. # List the files that the package holds, equal to `dpkg-query -L <pkg_name>`
  45. sudo pacman -Fl <pkg_name>
  46. # Displays packages which provide the given exp. aka reverse provides, equal to `apt-file search <pkg_name>`
  47. sudo pacman -F <pkg_name>
  48. # Search all packages to find the one which holds the specified file, equal to `apt-file search <file_name>`
  49. sudo pacman -F <file_name>
  50. # Show the changelog of a package, equal to `apt-get changelog <pkg_name>`
  51. sudo pacman -Qc <pkg_name>
  52. # Lists packages which have an update available, equal to `apt-get upgrade <- N`
  53. sudo pacman -Qu
  54. # Display a list of all packages in all installation sources that are handled by the packages management, equal to `apt-cache dumpavail` or `apt-cache dump`(Cache only) or `apt-cache pkgnames`
  55. sudo pacman -Sl
  56. # Generates a list of installed packages, equal to `dpkg --list | grep ^i`
  57. sudo pacman -Q
  58. # List packages that are installed but are not available in any installation source (anymore), equal to `deborphan`
  59. sudo pacman -Qm
  60. # List installed local packages along with version, equal to `dpkg -l`
  61. sudo pacman -Q
  62. # Search locally installed package for names or descriptions, equal to `aptitude search ~i(~n $name|~d $description)`
  63. sudo pacman -Qs <keyword>
  64. # List packages not required by any other package, equal to `deborphan -anp1`
  65. sudo pacman -Qt
  66. # List packages installed explicitly (not as dependencies), equal to `apt-mark showmanual`
  67. sudo pacman -Qe
  68. # List packages installed automatically (as dependencies), equal to `apt-mark showauto`
  69. sudo pacman -Qd
  70. # Display packages which require X to be installed, equal to `apt-cache rdepends <pkg_name>` or `aptitude search ~D$pattern`
  71. sudo pacman -Sii <pkg_name>
  72. # List all packages which are required for the given package, equal to `apt-cache depends <pkg_name>` or `apt-cache show <pkg_name>`
  73. sudo pacman -Qi <pkg_name>
  74. # List all packages which are required for the given package, equal to `apt-cache depends <pkg_name>` or `apt-cache show <pkg_name>`
  75. sudo pacman -Si <pkg_name>
  76. # Installation sources management, equal to `$EDITOR /etc/apt/sources.list`
  77. sudo $EDITOR /etc/pacman.conf
  78. # Add an installation source to the system, equal to `apt-cdrom add`
  79. sudo $EDITOR /etc/pacman.conf
  80. # Refresh the information about installation sources, equal to `apt-get update`
  81. sudo pacman -Sy
  82. # Prints a list of all installation sources, equal to `apt-cache policy`
  83. less /etc/pacman.d/mirrorlist
  84. # List all packages from a certain repo
  85. paclist <repo>
  86. # Add a package lock rule to keep its current state from being changed, modifying IgnorePkg array in the file, equal to `apt-mark hold <pkg_name>`
  87. sudo $EDITOR /etc/pacman.conf
  88. # Delete a package lock rule, modifying IgnorePkg array in the file, equal to `apt-mark unhold <pkg_name>`
  89. sudo $EDITOR /etc/pacman.conf
  90. # Show a listing of all lock rules, equal to `less /etc/apt/preferences`
  91. less /etc/pacman.conf
  92. # Set the priority of the given package to avoid upgrade, force downgrade or to overwrite any default behavior, modifying HoldPkg and/or IgnorePkg arrays, equal to `$EDITOR /etc/apt/preferences` or `apt-cache policy`
  93. sudo $EDITOR /etc/pacman.conf
  94. # Verify package(s), equal to `debsums`
  95. sudo pacman -Qk
  96. # Reinstall given package, equal to `apt install --reinstall <pkg_name_installed>`
  97. sudo pacman -S <pkg_name_installed>
  98. # Verify dependencies of the complete system, equal to `apt-get check`
  99. sudo pacman -Dk
  100. # Use some magic to fix broken dependencies in a system for pacman dependency level, equal to `apt-get --fix-broken && aptitude install`
  101. sudo pacman -Dk
  102. # Use some magic to fix broken dependencies in a system for shared library level, equal to `apt-get --fix-broken && aptitude install`
  103. findbrokenpkgs # from AUR
  104. # Use some magic to fix broken dependencies in a system for shared library level, equal to `apt-get --fix-broken && aptitude install`
  105. lddd # from devtools
  106. # Query a package supplied on the command line rather than an entry in the package management database, equal to `dpkg -I <pkg_name>`
  107. sudo pacman -Qp <pkg_name>
  108. # List the contents of a package file, equal to `dpkg -c <pkg_name>`
  109. sudo pacman -Qpl <pkg_name>
  110. # Install local package file, equal to `apt install <pkg_file>`
  111. sudo pacman -U <pkg_file>
  112. # Updates package(s) with local packages and uses the installation sources to resolve dependencies, equal to `debi <pkg_file>`
  113. sudo pacman -U <pkg_file>
  114. # Add a local package to the local package cache mostly for debugging purposes, equal to `apt-cache add <pkg_file>`
  115. sudo cp <pkg_file> /var/cache/pacman/pkg/
  116. # Extract a package, equal to `dpkg-deb -x <pkg_file>`
  117. tar -xf <pkg_file>
  118. # Install/Remove packages to satisfy build-dependencies. Uses information in the source package, equal to `apt-get build-dep`
  119. makepkg -seoc # Please use this with [ABS](https://wiki.archlinux.org/index.php/Arch_Build_System)
  120. # Download the corresponding source package(s) to the given package name(s), equal to `apt-get source` or `debcheckout`
  121. makepkg -o # Please use this with [ABS](https://wiki.archlinux.org/index.php/Arch_Build_System)
  122. # Build a package, equal to `debuild`
  123. makepkg -s
  124. # Check for possible packaging issues, equal to `lintian`
  125. namcap
  126. $ pkg_name_installed: sudo pacman -Qe