https://wiki.archlinux.org/api.php?action=feedcontributions&user=Cjc7373&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:17:32ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=List_of_applications/Utilities&diff=777087List of applications/Utilities2023-05-06T10:00:19Z<p>Cjc7373: /* Task managers */ update htop url</p>
<hr />
<div><noinclude><br />
[[Category:Applications]]<br />
[[Category:Lists of software]]<br />
[[es:List of applications (Español)/Utilities]]<br />
[[ja:アプリケーション一覧/ユーティリティ]]<br />
[[zh-hans:List of applications/Utilities]]<br />
{{List of applications navigation}}<br />
</noinclude><br />
== Utilities ==<br />
<br />
=== Terminal ===<br />
<br />
==== Command shells ====<br />
<br />
See the main article: [[Command-line shell]].<br />
<br />
See also [[Wikipedia:Comparison of command shells]].<br />
<br />
==== Terminal emulators ====<br />
<br />
Terminal emulators show a GUI Window that contains a terminal. Most emulate Xterm, which in turn emulates VT102, which emulates typewriter. For further background information, see [[Wikipedia:Terminal emulator]].<br />
<br />
For a comprehensive list, see [[Wikipedia:List of terminal emulators]].<br />
<br />
* {{App|[[Alacritty]]|A cross-platform, GPU-accelerated terminal emulator.|https://github.com/alacritty/alacritty|{{Pkg|alacritty}}}}<br />
* {{App|aterm|Xterm replacement with transparency support. It has been deprecated in favour of urxvt since 2008.|http://www.afterstep.org/aterm.php|{{AUR|aterm}}}}<br />
* {{App|cool-retro-term|A good looking terminal emulator which mimics the old cathode display.|https://github.com/Swordfish90/cool-retro-term|{{Pkg|cool-retro-term}}}}<br />
* {{App|CoreTerminal|Terminal emulator based on qtermwidget. Part of C-Suite.|https://cubocore.org/|{{AUR|coreterminal}}}}<br />
* {{App|CuteCom|A graphical serial terminal.|https://gitlab.com/cutecom/cutecom|{{AUR|cutecom}}}}<br />
* {{App|Deepin Terminal|Terminal emulation application for Deepin desktop.|https://www.deepin.org/en/original/deepin-terminal/|{{Pkg|deepin-terminal}}}}<br />
* {{App|Eterm|Terminal emulator intended as a replacement for xterm and designed for the [[Enlightenment]] desktop.|https://github.com/mej/Eterm|{{AUR|eterm}}}}<br />
* {{App|[[foot]]|Lightweight terminal emulator for Wayland with [[w:sixel|sixel]] support|https://codeberg.org/dnkl/foot|{{Pkg|foot}}}}<br />
* {{App|Hyper|A terminal with JS/CSS support. Based on the [https://electronjs.org/ Electron] platform.|https://github.com/zeit/hyper|{{AUR|hyper}}}}<br />
* {{App|[[Wikipedia:Konsole|Konsole]]|Terminal emulator included in the [[KDE]] desktop.|https://konsole.kde.org/|{{Pkg|konsole}}}}<br />
* {{App|[[kitty]]|A modern, hackable, featureful, OpenGL based terminal emulator|https://github.com/kovidgoyal/kitty|{{Pkg|kitty}}}}<br />
* {{App|Liri Terminal|Material Design terminal for Liri.|https://github.com/lirios/terminal|{{Pkg|liri-terminal}}}}<br />
* {{App|[[mlterm]]|A multi-lingual terminal emulator supporting various character sets and encodings, variable-width fonts and bidi rendering.|https://sourceforge.net/projects/mlterm/|{{AUR|mlterm-git}}}}<br />
* {{App|moserial|GTK-based serial terminal for the GNOME desktop.|https://wiki.gnome.org/Apps/Moserial|{{Pkg|moserial}}}}<br />
* {{App|[[PuTTY]]|Highly configurable ssh/telnet/serial console program.|https://www.chiark.greenend.org.uk/~sgtatham/putty/|{{Pkg|putty}}}}<br />
* {{App|QTerminal|Lightweight Qt-based terminal emulator.|https://github.com/qterminal/qterminal|{{Pkg|qterminal}}}}<br />
* {{App|[[Wikipedia:Rxvt|rxvt]]|Popular replacement for xterm.|https://rxvt.sourceforge.net/|{{AUR|rxvt}}}}<br />
* {{App|shellinabox|A web-based SSH Terminal|https://github.com/shellinabox/shellinabox|{{AUR|shellinabox-git}}}}<br />
* {{App|[[st]]|Simple terminal implementation for X.|https://st.suckless.org|{{AUR|st}}}}<br />
* {{App|Station|Terminal emulation features different view modes such as split vertically and horizontally, a tabbed interface, and copy and paste commands.|https://mauikit.org/|{{Pkg|maui-station}}}}<br />
* {{App|Terminology|Terminal emulator by the Enlightenment project team with innovative features: file thumbnails and media play like a media player.|https://www.enlightenment.org/about-terminology|{{Pkg|terminology}}}}<br />
* {{App|[[urxvt]]|Highly extendable (with Perl) unicode enabled rxvt-clone terminal emulator featuring tabbing, url launching, a Quake style drop-down mode and pseudo-transparency.|http://software.schmorp.de/pkg/rxvt-unicode.html|{{Pkg|rxvt-unicode}}}}<br />
* {{App|wayst|Simple terminal emulator for Wayland and X11 with OpenGL rendering and minimal dependencies.|https://github.com/91861/wayst|{{AUR|wayst-git}}}}<br />
* {{App|[[xterm]]|Simple terminal emulator for the X Window System. It provides DEC VT102 and Tektronix 4014 compatible terminals for programs that cannot use the window system directly.|https://invisible-island.net/xterm/|{{Pkg|xterm}}}}<br />
* {{App|[[Yakuake]]|Drop-down terminal (Quake style) emulator based on Konsole.|https://apps.kde.org/yakuake/|{{Pkg|yakuake}}}}<br />
* {{App|zutty|A high-end terminal for low-end systems.|https://tomscii.sig7.se/zutty/|{{Pkg|zutty}}}}<br />
<br />
===== VTE-based =====<br />
<br />
[https://wiki.gnome.org/Apps/Terminal/VTE VTE] (Virtual Terminal Emulator) is a widget developed during early GNOME days for use in the GNOME Terminal. It has since given birth to many terminals with similar capabilities.<br />
<br />
* {{App|Deepin Terminal (GTK version)|Old terminal emulation application for Deepin desktop.|https://github.com/linuxdeepin/deepin-terminal-gtk|{{Pkg|deepin-terminal-gtk}}}}<br />
* {{App|EasySSH|SSH Connection Manager.|https://github.com/muriloventuroso/easyssh|{{AUR|easyssh}}}}<br />
* {{App|Germinal|Minimalist terminal emulator which provides a borderless maximized terminal, attached to a tmux session by default, hence providing tabs and panels.|https://www.imagination-land.org/tags/germinal.html|{{AUR|germinal}}}}<br />
* {{App|Gnome Console|Formerly known as King’s Cross, a simple user-friendly terminal emulator for the [[GNOME]] desktop.|https://gitlab.gnome.org/GNOME/console|{{Pkg|gnome-console}}}}<br />
* {{App|[[Wikipedia:GNOME Terminal|GNOME Terminal]]|A terminal emulator included in the [[GNOME]] desktop with support for Unicode.|https://wiki.gnome.org/Apps/Terminal|{{Pkg|gnome-terminal}}}}<br />
* {{App|[[Guake]]|Drop-down terminal for the GNOME desktop.|http://guake-project.org/|{{Pkg|guake}}}}<br />
* {{App|kermit|A VTE-based terminal emulator that aims to be simple, fast and effective.|https://github.com/orhun/kermit|{{AUR|kermit}}}}<br />
* {{App|LXTerminal|Desktop independent terminal emulator for [[LXDE]].|https://wiki.lxde.org/en/LXTerminal{{Dead link|2022|09|20|status=404}}|{{Pkg|lxterminal}}}}<br />
* {{App|MATE terminal|A fork of [[Wikipedia:GNOME terminal]] for the [[MATE]] desktop.|https://www.mate-desktop.org/|{{Pkg|mate-terminal}}}}<br />
* {{App|Pantheon Terminal|A super lightweight, beautiful, and simple terminal emulator. It is designed to be setup with sane defaults and little to no configuration.|https://github.com/elementary/terminal|{{Pkg|pantheon-terminal}}}}<br />
* {{App|ROXTerm|Tabbed terminal emulator with a small footprint.|https://roxterm.sourceforge.net/|{{AUR|roxterm}}}}<br />
* {{App|sakura|Terminal emulator based on GTK and VTE.|https://www.pleyades.net/david/projects/sakura|{{AUR|sakura}}}}<br />
* {{App|[[Terminator]]|Terminal emulator supporting multiple resizable terminal panels.|https://gnome-terminator.org/|{{Pkg|terminator}}}}<br />
* {{App|[[Termite]]|Keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support. Unmaintained - the developers recommend switching to Alacritty.|https://github.com/thestinger/termite|{{AUR|termite}}}}<br />
* {{App|Termit|Simple VTE-based terminal emulator with Lua scripting support|https://github.com/nonstop/termit|{{AUR|termit-git}}}}<br />
* {{App|Tilda|Configurable drop down terminal emulator.|https://github.com/lanoxx/tilda/|{{Pkg|tilda}}}}<br />
* {{App|Tilix|Tiling terminal emulator for GNOME.|https://gnunn1.github.io/tilix-web/|{{Pkg|tilix}}}}<br />
* {{App|[[Wikipedia:Terminal (Xfce)|Xfce Terminal]]|Terminal emulator included in the [[Xfce]] desktop with support for a colorized prompt and a tabbed interface.|https://docs.xfce.org/apps/terminal/start|{{Pkg|xfce4-terminal}}}}<br />
<br />
===== KMS-based =====<br />
<br />
The following terminal emulators are based on the [[kernel mode setting]] that could be invoked without X.<br />
* {{App|[[KMSCON]]|A KMS/DRM-based system console(getty) with an integrated terminal emulator for Linux operating systems.|https://github.com/dvdhrm/kmscon|{{AUR|kmscon}}}}<br />
<br />
===== framebuffer-based =====<br />
<br />
In the GNU/Linux world, the [[Wikipedia:Framebuffer|framebuffer]] can refer to a virtual device in the Linux kernel ('''fbdev''') or the virtual framebuffer system for X ('''xvfb'''). This section mainly lists the terminal emulators based on the in-kernel virtual device, i.e. '''fbdev'''.<br />
<br />
* {{App|yaft|A simple terminal emulator for living without X, with UCS2 glyphs, wallpaper and 256color support.|https://github.com/uobikiemukot/yaft|{{AUR|yaft}}}}<br />
<br />
* {{App|[[Fbterm]]|a fast FrameBuffer based TERMinal emulator for linux|https://salsa.debian.org/debian/fbterm|{{AUR|fbterm}}}}<br />
<br />
==== Terminal pagers ====<br />
<br />
See also [[Wikipedia:Terminal pager]].<br />
<br />
* {{App|[[less]]|A program similar to more, but with support for both forward and backward scrolling, as well as partial loading of files.|https://www.gnu.org/software/less/|{{Pkg|less}}}}<br />
* {{App|mcview|A pager with mouse and colour support. It is bundled with midnight commander.|https://midnight-commander.org/|{{Pkg|mc}}}}<br />
* {{App|moar|Moar is a pager. It's designed to just do the right thing without any configuration. |https://github.com/walles/moar|{{AUR|moar}}}}<br />
* {{App|[[Wikipedia:More_(command)|more]]|A simple and feature-light pager. It is a part of util-linux.|https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/about/|{{Pkg|util-linux}}}}<br />
* {{App|[[Wikipedia:Most_(Unix)|most]]|A pager with support for multiple windows, left and right scrolling, and built-in colour support|http://www.jedsoft.org/most/|{{Pkg|most}}}}<br />
* [[Vim]] can [[Vim#Vim as a pager|also be used as a pager]].<br />
<br />
==== Terminal multiplexers ====<br />
<br />
See also [[Wikipedia:Terminal multiplexer]].<br />
<br />
* {{App|[[abduco]]|Tool for session attach and detach support which allows a process to run independently from its controlling terminal.|https://www.brain-dump.org/projects/abduco/|{{Pkg|abduco}}}}<br />
* {{App|[[Wikipedia:Byobu (software)|byobu]]|An GPLv3 licensed addon for tmux or screen. It requires a terminal multiplexer installed.|https://byobu.org/|{{Pkg|byobu}}}}<br />
* {{App|[[dtach]]|Program that emulates the detach feature of [[GNU Screen]].|http://dtach.sourceforge.net/|{{AUR|dtach}}}}<br />
* {{App|dvtm|[[dwm]]-style window manager in the console.|https://www.brain-dump.org/projects/dvtm/|{{Pkg|dvtm}}}}<br />
* {{App|[[GNU Screen]]|Full-screen window manager that multiplexes a physical terminal.|https://www.gnu.org/software/screen/|{{Pkg|screen}}}}<br />
* {{App|mtm|Simple terminal multiplexer with just four commands: change focus, split, close, and screen redraw.|https://github.com/deadpixi/mtm|{{AUR|mtm-git}}}}<br />
* {{App|tmate|A fork of [[tmux]] aiming to help with remote access and pair programming.|https://tmate.io/|{{Pkg|tmate}}}}<br />
* {{App|[[tmux]]|BSD licensed terminal multiplexer.|https://tmux.github.io/|{{Pkg|tmux}}}}<br />
* {{App|zellij|Terminal multiplexer on steroids written in Rust|https://zellij.dev/|{{Pkg|zellij}}}}<br />
* {{App|wezterm|GPU-accelerated cross-platform terminal emulator and multiplexer implemented in [[Rust]].|https://wezfurlong.org/wezterm/|{{Pkg|wezterm}}}}<br />
{{Tip|[[Kitty]], a terminal emulator, offers similar functions.}}<br />
<br />
=== Files ===<br />
<br />
==== File managers ====<br />
<br />
See also [[Wikipedia:Comparison of file managers]].<br />
<br />
===== Console =====<br />
<br />
* {{App|Clex|File manager with full-screen user interface|http://www.clex.sk/|{{AUR|clex}}}}<br />
* {{App|CliFM|The command line file manager: full-featured, fast, extensible, and lightweight as hell.|https://github.com/leo-arch/clifm|{{AUR|clifm}}}}<br />
* {{App|ded|directory editor, file manager similar to Emacs dired|https://invisible-island.net/ded/ded.html|{{AUR|ded}}}}<br />
* {{App|[[Wikipedia:Dired|Dired]]|Directory editor integrated with [[Emacs]].|https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html|{{Pkg|emacs}}}}<br />
* {{App|fff|A simple file manager written in Bash.|https://github.com/dylanaraps/fff|{{Pkg|fff}}}}<br />
* {{App|fm|A terminal based file manager.|https://github.com/knipferrc/fm|{{AUR|fm-git}}}}<br />
* {{App|joshuto|ranger-like terminal file manager written in Rust.|https://github.com/kamiyaa/joshuto|{{AUR|joshuto-git}}}}<br />
* {{App|Last File Manager|Powerful file manager written in Python 3 with a curses interface.|https://inigo.katxi.org/devel/lfm/|{{AUR|lfm}}}}<br />
* {{App|lf|Terminal file manager written in Go using server/client architecture.|https://github.com/gokcehan/lf|{{Pkg|lf}}}}<br />
* {{App|[[Midnight Commander]]|Console-based, dual-paneled file manager.|https://midnight-commander.org|{{Pkg|mc}}}}<br />
* {{App|nffm|"Nothing Fancy File Manager", a mouseless ncurses file manager written in C.|https://github.com/mariostg/nffm|{{AUR|nffm-git}}}}<br />
* {{App|[[nnn]]|Tiny, lightning fast, feature-packed file manager.|https://github.com/jarun/nnn|{{Pkg|nnn}}}}<br />
* {{App|Pilot|File manager that comes with the [[Alpine]] email client.|https://alpine.x10host.com/{{Dead link|2022|09|20|status=domain name not resolved}}|{{AUR|alpine-git}}}}<br />
* {{App|[[Ranger]]|Console-based file manager with vi bindings, customizability, and lots of features.|https://ranger.github.io/|{{Pkg|ranger}}}}<br />
* {{App|sfm|simple file manager for unix-like systems.|https://github.com/afify/sfm|{{AUR|sfm}}}}<br />
* {{App|TUIFI Manager|A cross-platform terminal-based termux-oriented file manager (and component), meant to be used with a Uni-Curses project or as is.|https://github.com/GiorgosXou/TUIFIManager|{{AUR|tuifimanager}}}}<br />
* {{App|[[Vifm]]|Ncurses-based two-panel file manager with vi-like keybindings.|https://vifm.info|{{Pkg|vifm}}}}<br />
* {{App|xplr|A hackable, minimal, fast TUI file explorer.|https://xplr.dev|{{Pkg|xplr}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|Caja|The file manager for the MATE desktop.|https://github.com/mate-desktop/caja|{{Pkg|caja}}}}<br />
* {{App|CoreFM|Simple lightweight easy to use file manager with many features like image previews, mime-icon support, split view, auto-mounting of removable media, drag-n-drop support etc. Part of C-Suite.|https://cubocore.org/|{{AUR|corefm}}}}<br />
* {{App|Deepin File Manager|File manager developed for [[Deepin]].|https://www.deepin.org/en/original/dde-file-manager/|{{Pkg|deepin-file-manager}}}}<br />
* {{App|[[Dolphin]]|File manager included in the KDE desktop.|https://apps.kde.org/dolphin/|{{Pkg|dolphin}}}}<br />
* {{App|fm|Small, general purpose file manager built with GTK4.|https://github.com/euclio/fm|}}<br />
* {{App|Gentoo|A lightweight file manager for GTK.|https://sourceforge.net/projects/gentoo/|{{AUR|gentoo}}}}<br />
* {{App|[[GNOME Files]]|Extensible, heavyweight file manager used by default in GNOME with support for custom scripts.|https://wiki.gnome.org/Apps/Files|{{Pkg|nautilus}}}}<br />
* {{App|Index|File manager that lets you browse your system files and applications and preview your music, text, image and video files and share them with external applications.|https://apps.kde.org/index-fm/|{{Pkg|index-fm}}}}<br />
* {{App|[[Wikipedia:Konqueror|Konqueror]]|File manager and web browser for the KDE desktop.|https://apps.kde.org/konqueror/|{{Pkg|konqueror}}}}<br />
* {{App|Liri Files|The file manager for Liri.|https://github.com/lirios/files|{{Pkg|liri-files}}}}<br />
* {{App|[[Nemo]]|Nemo is the file manager of the Cinnamon desktop. A fork of Nautilus.|https://projects.linuxmint.com/cinnamon/|{{Pkg|nemo}}}}<br />
* {{App|Pantheon Files|File browser designed for elementary OS.|https://github.com/elementary/files|{{Pkg|pantheon-files}}}}<br />
* {{App|PathFinder|File browser that comes with the [[Wikipedia:Fox_toolkit|FOX toolkit]].|http://fox-toolkit.org/|{{Pkg|fox}}}}<br />
* {{App|[[PCManFM]]|Very fast and lightweight file manager which can also optionally manage the desktop icons and background.|https://wiki.lxde.org/en/PCManFM{{Dead link|2022|09|20|status=404}}|{{Pkg|pcmanfm}}, {{Pkg|pcmanfm-gtk3}}}}<br />
* {{App|[[PCManFM]]-Qt|Qt port of PCManFM file manager.|https://github.com/lxqt/pcmanfm-qt|{{Pkg|pcmanfm-qt}}}}<br />
* {{App|Peony|File manager for the UKUI desktop.|https://github.com/ukui/peony|{{Pkg|peony}}}}<br />
* {{App|qtFM|Small, lightweight filemanager for Linux desktops based on pure Qt.|https://qtfm.eu/|{{AUR|qtfm}}}}<br />
* {{App|ROX Filer|Small and fast file manager which can optionally manage the desktop background and panels.|https://rox.sourceforge.net/|{{AUR|rox}}}}<br />
* {{App|[[Thunar]]|File manager that can be run as a daemon with excellent start up and directory load times.|https://docs.xfce.org/xfce/thunar/start|{{Pkg|thunar}}}}<br />
<br />
====== Twin-panel ======<br />
<br />
Note that some of these twin-panel file managers can also be set to have only one pane.<br />
<br />
* {{App|Double Commander|File manager with two panels side by side. It is inspired by Total Commander and features some new ideas.|https://doublecmd.sourceforge.io/|GTK: {{Pkg|doublecmd-gtk2}}, Qt5: {{Pkg|doublecmd-qt5}}}}<br />
* {{App|[[Wikipedia:GNOME Commander|GNOME Commander]]|A dual-paned file manager for the GNOME Desktop.|https://gcmd.github.io/|{{AUR|gnome-commander}}}}<br />
* {{App|[[Wikipedia:Krusader|Krusader]]|Advanced twin panel (Midnight Commander style) file manager for the KDE desktop.|https://krusader.org/|{{Pkg|krusader}}}}<br />
* {{App|muCommander|A lightweight, cross-platform file manager with a dual-pane interface written in Java.|https://www.mucommander.com/|{{AUR|mucommander}}}}<br />
* {{App|[[SpaceFM]]|GTK multi-panel tabbed file manager.|https://ignorantguru.github.io/spacefm/|{{AUR|spacefm}}}}<br />
* {{App|Sunflower|Small and highly customizable twin-panel file manager for Linux with support for plugins.|https://sunflower-fm.org/|{{AUR|sunflower}}}}<br />
* {{App|trolCommander|Lightweight, dual-pane file manager written in Java. Fork of muCommander.|https://github.com/trol73/mucommander|{{AUR|trolcommander}}}}<br />
* {{App|Tux Commander|Windowed file manager with two panels side by side similar to popular Total Commander or Midnight Commander file managers.|http://tuxcmd.sourceforge.net/description.php|{{AUR|tuxcmd}}}}<br />
* {{App|Worker|Fast, lightweight and feature-rich file manager for the X Window System.|http://www.boomerangsworld.de/cms/worker/|{{AUR|worker}}}}<br />
* {{App|[[Wikipedia:Xfe|Xfe]]|Microsoft Explorer-like file manager for X (X File Explorer).|http://roland65.free.fr/xfe/|{{AUR|xfe}}}}<br />
<br />
==== Trash management ====<br />
<br />
See [[Trash management#Trash creation]].<br />
<br />
==== File synchronization and backup ====<br />
<br />
{{Merge|Synchronization and backup programs#Data synchronization|There is a dedicated article.}}<br />
<br />
See also [[Synchronization and backup programs]], [[Wikipedia:Comparison of file synchronization software]], and [[Wikipedia:Comparison of backup software]].<br />
<br />
* {{App|borg|Deduplicating backup program with compression and authenticated encryption that supports backing up over ssh|https://www.borgbackup.org|{{Pkg|borg}}}}<br />
* {{App|Déjà Dup|Simple GTK backup program. It hides the complexity of doing backups the 'right way' (encrypted, off-site, and regular) and uses [[duplicity]] as the backend.|https://launchpad.net/deja-dup|{{Pkg|deja-dup}}}}<br />
* {{App|[[Wikipedia:DirSync Pro|DirSync Pro]]|Small, but powerful utility for file and folder synchronization.|https://dirsyncpro.org/|{{AUR|dirsyncpro}}}}<br />
* {{App|[[Wikipedia:Duplicati|Duplicati]]|Backup client that securely stores encrypted, incremental, compressed backups on cloud storage services and remote file servers.|https://www.duplicati.com/|{{AUR|duplicati-canary-bin}}}}<br />
* {{App|[[duplicity]]|Simple command-line utility which allows encrypted compressed incremental backup to nearly any storage.|https://www.nongnu.org/duplicity/|{{Pkg|duplicity}}}}<br />
* {{App|[[Duply]]|Command-line front-end for [[duplicity]] which simplifies running it. It manages backup job settings in profiles and allows to batch execute commands.|https://www.duply.net/|{{AUR|duply}}}}<br />
* {{App|[[Wikipedia:FreeFileSync|FreeFileSync]]|Folder comparison and synchronization software that creates and manages backup copies of all your important files.|https://www.freefilesync.org/|{{AUR|freefilesync}}}}<br />
* {{App|[[Wikipedia:git-annex|git-annex]]|Manage files with git, without checking the file contents into git.|https://git-annex.branchable.com/|{{Pkg|git-annex}}}}<br />
* {{App|[[Wikipedia:grsync|grsync]]|GTK+ GUI for rsync to synchronize folders, files and make backups|https://www.opbyte.it/grsync/|{{Pkg|grsync}}}}<br />
* {{App|hsync|Command line program to sync only those files that have been renamed/moved but otherwise unchanged. It works by issuing simple move operations at the destination without actually transferring the files, and is meant to be used in conjunction with other synchronization programs that lack this capability.|https://ambrevar.bitbucket.io/hsync/|{{AUR|hsync}}}}<br />
* {{App|rclone|Command line program to sync files and directories to and from Amazon S3, Dropbox, Google Drive, Microsoft OneDrive, Yandex Disk and many other cloud storage services as well as between local paths.|https://rclone.org/|{{Pkg|rclone}}}}<br />
* {{App|restic|Fast, secure, efficient backup program that supports backing up to many cloud services.|https://restic.net/|{{Pkg|restic}}}}<br />
* {{App|[[rsync]]|File transfer program that uses the "rsync algorithm" which provides a very fast method for bringing remote files into sync. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand. Has [[Rsync#Front-ends|multiple frontends available]].|https://rsync.samba.org/|{{Pkg|rsync}}}}<br />
* {{App|[[Wikipedia:SparkleShare|SparkleShare]]|File sharing and collaboration application written in C#. It can sync with any Git server over SSH.|https://www.sparkleshare.org/|{{Pkg|sparkleshare}}}}<br />
* {{App|[[Syncthing]]|Continuous file synchronization program. It synchronizes files between two or more computers in a simple way without advanced configuration.|https://syncthing.net/|{{Pkg|syncthing}}}}<br />
* {{App|Syncany|Cloud storage and filesharing application with a focus on security and abstraction of storage.|https://www.syncany.org/|{{AUR|syncany}}}}<br />
* {{App|[[Wikipedia:Synkron|Synkron]]|Application that helps you keep your files and folders always updated. You can easily sync your documents, music or pictures to have their latest versions everywhere.|https://synkron.sourceforge.net/|{{AUR|synkron}}}}<br />
* {{App|[[Wikipedia:Tarsnap|Tarsnap]]|Secure, efficient proprietary online backup service.|https://www.tarsnap.com/|{{Pkg|tarsnap}}}}<br />
* {{App|Timeshift|A system restore tool for Linux.|https://github.com/teejee2008/timeshift|{{AUR|timeshift}}}}<br />
* {{App|[[Unison]]|File synchronization tool that allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.|https://www.cis.upenn.edu/~bcpierce/unison/|{{Pkg|unison}}}}<br />
* {{App|YARsync|A Python wrapper around rsync, providing file synchronization and backup with an interface similar to git.|https://github.com/ynikitenko/yarsync|{{AUR|yarsync}}}}<br />
<br />
==== Archiving and compression tools ====<br />
<br />
For archiving and compression command-line tools, see [[Archiving and compression]].<br />
<br />
===== Archive managers =====<br />
<br />
* {{App|360zip|A proprietary archiving tool.|https://yasuo.360.cn/|{{AUR|360zip}}}}<br />
* {{App|[[Wikipedia:Ark (software)|Ark]]|Archiving tool included in the KDE desktop.|https://apps.kde.org/ark/|{{Pkg|ark}}}}<br />
* {{App|Arqiver|Simple Qt archive manager based on libarchive.|https://github.com/tsujan/Arqiver|{{AUR|arqiver-git}}}}<br />
* {{App|CoreArchiver|Simple file compressing/extracting utility based on Qt and libarchive-qt. Part of C-Suite.|https://cubocore.org/|{{AUR|corearchiver}}}}<br />
* {{App|Deepin Archive Manager|Fast and lightweight application for creating and extracting archives.|https://github.com/linuxdeepin/deepin-compressor|{{Pkg|deepin-compressor}}}}<br />
* {{App|Engrampa|Archive manager for [[MATE]]|https://github.com/mate-desktop/engrampa|{{Pkg|engrampa}}}}<br />
* {{App|[[Wikipedia:GNOME Archive Manager|GNOME Archive Manager]]|Archive manager included in the GNOME desktop (previously File Roller).|https://wiki.gnome.org/Apps/FileRoller|{{Pkg|file-roller}}}}<br />
* {{App|LXQt File Archiver|Simple and lightweight desktop-agnostic Qt file archiver.|https://github.com/lxqt/lxqt-archiver|{{Pkg|lxqt-archiver}}}}<br />
* {{App|p7zip-gui|The GUI belonging to the p7zip software.|https://p7zip.sourceforge.net/|{{AUR|p7zip-gui}}}}<br />
* {{App|[[Wikipedia:PeaZip|PeaZip]]|Open source file and archive manager.|https://peazip.github.io/peazip-linux.html|GTK: {{AUR|peazip-gtk2-bin}}, Qt: {{AUR|peazip-qt-bin}}}}<br />
* {{App|[[Wikipedia:Xarchiver|Xarchiver]]|Lightweight desktop independent archive manager built with GTK.|https://github.com/ib/xarchiver|GTK 3: {{Pkg|xarchiver}}, GTK 2: {{Pkg|xarchiver-gtk2}}}}<br />
<br />
==== Comparison, diff, merge ====<br />
<br />
See also [[Wikipedia:Comparison of file comparison tools]].<br />
<br />
For managing ''pacnew''/''pacsave'' files, specialised tools exist. See [[Pacnew and Pacsave files#Managing .pac* files]].<br />
<br />
===== Console =====<br />
<br />
See {{man|1|diff}} from {{Pkg|diffutils}} and [[Core utilities#diff alternatives|its alternatives]].<br />
<br />
* {{App|colordiff|A Perl script wrapper for 'diff' that produces the same output but with pretty 'syntax' highlighting.|https://www.colordiff.org/|{{Pkg|colordiff}}}}<br />
* {{app|diff-highlight|Perl script to highlight changed parts within pairable lines of {{ic|diff -u}} output|https://github.com/git/git/tree/master/contrib/diff-highlight|{{pkg|git}}}}<br />
* {{App|diffr|A Rust utility to pretty-print diff with highlighting at word-level for ease of review.|https://github.com/mookid/diffr|{{AUR|diffr}}}}<br />
* {{App|ydiff|A Python wrapper to get highlighted diff output from stdin or VCS-tracked file/dirs, in either unfied or side-by-side view.|https://github.com/ymattw/ydiff|{{AUR|ydiff}}}}<br />
* {{App|delta|A diff viewer written in Rust with syntax highlighting.|https://github.com/dandavison/delta|{{Pkg|git-delta}}}}<br />
* {{App|diff-so-fancy|A diff output decorator. It does not calculate the diff, it only decorates it.|https://github.com/so-fancy/diff-so-fancy|{{Pkg|diff-so-fancy}}}}<br />
* {{App|difftastic|Compares files using their syntax trees|https://difftastic.wilfred.me.uk|{{Pkg|difftastic}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|DiffPDF|Compare the text or the visual appearance of each page in two PDF files.|https://gitlab.com/eang/diffpdf|{{Pkg|diffpdf}}}}<br />
* {{App|Diffuse|Small and simple text merge tool written in Python.|https://diffuse.sourceforge.net/|{{Pkg|diffuse}}}}<br />
* {{App|KDiff3|File and directory diff and merge tool for the KDE desktop.|https://apps.kde.org/kdiff3/|{{Pkg|kdiff3}}}}<br />
* {{App|Kompare|GUI front-end program for viewing and merging differences between source files. It supports a variety of diff formats and provides many options to customize the information level displayed.|https://apps.kde.org/kompare/|{{Pkg|kompare}}}}<br />
* {{App|[[Wikipedia:Meld (software)|Meld]]|Visual diff and merge tool that can compare files, directories, and version controlled projects.|https://meldmerge.org/|{{Pkg|meld}}}}<br />
* {{App|xxdiff|A graphical browser for file and directory differences.|https://furius.ca/xxdiff/|{{AUR|xxdiff}}}}<br />
<br />
[[Vim]] and [[Emacs]] provide merge functionality with [[Vim#Merging files|vimdiff]] and {{ic|ediff}}.<br />
<br />
==== Batch renamers ====<br />
<br />
===== Console =====<br />
<br />
See {{man|1|rename}} from {{Pkg|util-linux}}.<br />
<br />
* {{App|edir|Rename, delete, and copy files and directories using your editor (enhanced vidir).|https://github.com/bulletmark/edir|{{AUR|edir}}}}<br />
* {{App|f2|Cross-platform command-line tool for batch renaming files and directories quickly and safely, can also rename files based on audio tags.|https://github.com/ayoisaiah/f2|{{AUR|f2}}}}<br />
* {{App|nomino|A batch rename utility for developers.|https://github.com/yaa110/nomino|{{AUR|nomino}}}}<br />
* {{App|rename.pl|Batch renamer based on perl regex.|https://search.cpan.org/~pederst/rename/|{{Pkg|perl-rename}}}}<br />
* {{App|vidir|Rename and delete files and directories using your editor.|https://linux.die.net/man/1/vidir|{{AUR|vidir}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|Caja-Rename|Batch renaming extension for Caja.|https://tari.in/www/software/caja-rename|{{AUR|caja-rename}}}}<br />
* {{App|CoreRenamer|Simple lightweight batch file renamer application. Part of C-Suite.|https://cubocore.org/|{{AUR|corerenamer}}}}<br />
* {{App|[[Wikipedia:GPRename|GPRename]]|GTK batch renamer for files and directories.|http://gprename.sourceforge.net|{{Pkg|gprename}}}}<br />
* {{App|[[Wikipedia:KRename|KRename]]|Very powerful batch file renamer for the KDE desktop.|https://apps.kde.org/krename/|{{Pkg|krename}}}}<br />
* {{App|metamorphose2|wxPython based batch renamer with support for regular expressions, renaming multimedia files according to their metadata, etc.|http://file-folder-ren.sourceforge.net|{{AUR|metamorphose2}}}}<br />
* {{App|[[Thunar]] Bulk Rename|Change the name of multiple files at once using some criterion that applies to at least one of the files. Run with {{ic|thunar -B}}.|https://docs.xfce.org/xfce/thunar/bulk-renamer/start|{{Pkg|thunar}}}}<br />
<br />
==== File searching ====<br />
<br />
This section lists utilities for file searching based on filename, file path or metadata. For full-text searching, see the next section.<br />
<br />
See also [[Wikipedia:List of search engines#Desktop search engines]].<br />
<br />
===== Console =====<br />
<br />
See {{man|1|find}} from {{Pkg|findutils}} and [[Core utilities#find alternatives|its alternatives]].<br />
<br />
===== Graphical =====<br />
<br />
* {{App|Catfish|Versatile file searching tool by Xfce, can be powered by find, locate and Zeitgeist.|https://launchpad.net/catfish-search|{{Pkg|catfish}}}}<br />
* {{App|CoreHunt|Easy to use fast file searching tool with categorized search and search history. Part of C-Suite.|https://cubocore.org/|{{AUR|corehunt}}}}<br />
* {{App|Czkawka|GTK file searching utility with advanced features, it can also find similar images and videos.|https://github.com/qarmin/czkawka|{{AUR|czkawka-gui}}}}<br />
* {{App|GNOME Search Tool|GNOME utility to search for files, depends on [[GNOME/Files]].|https://gitlab.gnome.org/GNOME/gnome-search-tool|{{AUR|gnome-search-tool}}}}<br />
* {{App|KFind|Search tool for KDE to find files by name, type or content. Has internal search and supports locate.|https://apps.kde.org/kfind/|{{Pkg|kfind}}}}<br />
* {{App|MATE Search Tool|MATE utility to search for files.|https://github.com/mate-desktop/mate-utils|{{Pkg|mate-utils}}}}<br />
* {{App|regexxer|Interactive search and replace tool featuring Perl-style regular expressions.|http://regexxer.sourceforge.net/|{{Pkg|regexxer}}}}<br />
* {{App|Searchmonkey|Powerful GUI search utility for matching regex patterns.|https://sourceforge.net/projects/searchmonkey/|{{AUR|searchmonkey-gtk}}}}<br />
<br />
====== File indexers ======<br />
<br />
These programs index your files to allow for quick searching.<br />
<br />
* {{App|Basenji|Volume indexing tool designed for easy and fast indexing of CD/DVD and other type of volume collections.|https://github.com/pulb/basenji|{{AUR|basenji}}}}<br />
* {{App|fsearch|A fast file search utility for Unix-like systems based on GTK 3.|https://github.com/cboxdoerfer/fsearch|{{AUR|fsearch-git}}}}<br />
* {{App|angrysearch|Linux file search tool with instant results as you type.|https://github.com/DoTheEvo/ANGRYsearch|{{AUR|angrysearch}}}}<br />
<br />
==== Full-text searching ====<br />
<br />
See {{man|1|grep}} from {{Pkg|grep}} and [[Core utilities#grep alternatives|its alternatives]], which provide non-indexed [[Wikipedia:Full-text search|full-text search]].<br />
<br />
===== Full-text indexers =====<br />
<br />
* {{App|[[Baloo]]|KDE's file indexing and search solution, has a CLI and is used by [[KRunner]].|https://community.kde.org/Baloo|{{Pkg|baloo}}}}<br />
* {{App|[[Wikipedia:DocFetcher|DocFetcher]]|Graphical Java desktop search application.|https://docfetcher.sourceforge.net|{{AUR|docfetcher}}}}<br />
* {{App|MeiliSearch|Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine.|https://www.meilisearch.com/|{{Pkg|meilisearch}}}}<br />
* {{App|Namazu|A Full-Text Search Engine|http://www.namazu.org/|{{Pkg|namazu}}}}<br />
* {{App|[[Wikipedia:Recoll|Recoll]]|Full text search tool based on Xapian, has CLI and GUI.|https://lesbonscomptes.com/recoll/|{{Pkg|recoll}}}}<br />
* {{App|[[Wikipedia:Tracker (search software)|Tracker]]|All-in-one indexer, search tool and metadata database, used by [[GNOME]] Documents, Music, Photos and Videos.|https://gnome.pages.gitlab.gnome.org/tracker/|{{Pkg|tracker3}}}}<br />
* {{App|[[Zeitgeist]]|Event aggregation framework for the user's activities and notifications (files opened, websites visited, conversations had, etc.), has several third-party front-ends.|https://launchpad.net/zeitgeist-project|{{Pkg|zeitgeist}}}}<br />
<br />
=== Development ===<br />
<br />
==== Code forges ====<br />
<br />
* {{App|[[GitLab]]|Project management and code hosting application.|https://gitlab.com/gitlab-org/gitlab-foss|{{Pkg|gitlab}}}}<br />
* {{App|[[Gitea]]|Painless self-hosted Git service. Community managed fork of Gogs.|https://gitea.io|{{Pkg|gitea}}}}<br />
<br />
===== Code forge clients =====<br />
<br />
* {{App|git-open|Open a repository website (GitHub, GitLab, Bitbucket) in your browser|https://github.com/paulirish/git-open|{{AUR|git-open}}}}<br />
* {{App|github-cli|GitHub's official command line tool|https://github.com/cli/cli|{{Pkg|github-cli}}}}<br />
* {{App|hub|Command line interface for GitHub|https://hub.github.com|{{Pkg|hub}}}}<br />
* {{App|hut|Command line interface for Sourcehut|https://sr.ht/~emersion/hut/|{{Pkg|hut}}}}<br />
* {{App|lab|A hub-like tool for GitLab|https://zaquestion.github.io/lab/|{{AUR|lab-bin}}}}<br />
* {{App|snippet|A terminal based interface to create a new GitLab snippet|https://gitlab.com/zj/snippet|{{AUR|snippet}}}}<br />
<br />
==== Version control systems ====<br />
<br />
See also [[Wikipedia:Comparison of revision control software]].<br />
<br />
* {{App|[[Bazaar]]|Distributed version control system that helps you track project history over time and to collaborate easily with others.|https://bazaar.canonical.com/|{{AUR|bzr}}}}<br />
* {{App|[[CVS]]|Concurrent Versions System, a client-server revision control system.|http://cvs.nongnu.org/|{{Pkg|cvs}}}}<br />
* {{App|[[Wikipedia:Darcs|Darcs]]|Distributed revision control system that was designed to replace traditional, centralized source control systems such as CVS and Subversion.|http://darcs.net/|{{Pkg|darcs}}}}<br />
* {{App|[[Wikipedia:Fossil (software)|Fossil]]|Distributed VCS with bug tracking, wiki, forum, and technotes.|https://www.fossil-scm.org/|{{Pkg|fossil}}}}<br />
* {{App|[[Git]]|Distributed revision control and source code management system with an emphasis on speed.|https://git-scm.com/|{{Pkg|git}}}}<br />
* {{App|[[Mercurial]]|Distributed version control system written in Python and similar in many ways to Git.|https://www.mercurial-scm.org/|{{Pkg|mercurial}}}}<br />
* {{App|[[Subversion]]|Full-featured centralized version control system originally designed to be a better CVS.|https://subversion.apache.org/|{{Pkg|subversion}}}}<br />
<br />
==== Build automation ====<br />
<br />
See also [[Wikipedia:List of build automation software]].<br />
<br />
* {{App|[[Wikipedia:Apache Ant|Apache Ant]]|Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other.|https://ant.apache.org/|{{Pkg|ant}}}}<br />
* {{App|[[Apache Maven]]|Build automation tool used primarily for Java.|https://maven.apache.org/|{{Pkg|maven}}}}<br />
* {{App|[[Wikipedia:Bazel (software)|Bazel]]|An open-source tool that allows for the automated building and testing of software.|https://bazel.build/|{{Pkg|bazel}}}}<br />
* {{App|[[Wikipedia:CMake|CMake]]|Family of tools designed to build, test and package software.|https://cmake.org/|{{Pkg|cmake}}}}<br />
* {{App|[[Wikipedia:Make (software)|GNU make]]|GNU make utility to maintain groups of programs.|https://www.gnu.org/software/make/|{{Pkg|make}} (dependency of {{Pkg|base-devel}})}}<br />
* {{App|[[Wikipedia:Meson (software)|Meson]]|Extremely fast and user friendly build system.|https://mesonbuild.com/|{{Pkg|meson}}}}<br />
* {{App|[[Wikipedia:Gradle|Gradle]]|Powerful build system for the JVM.|https://gradle.org/|{{Pkg|gradle}}}}<br />
* {{App|Phing|PHP program designed to automate tasks of all kinds.|https://www.phing.info/|{{AUR|phing}}}}<br />
<br />
==== Integrated development environments ====<br />
<br />
See also [[Wikipedia:Comparison of integrated development environments]].<br />
<br />
For PHP specific list, see [[PHP#Development tools]].<br />
<br />
* {{App|[[Android Studio]]|The official Android development environment based on IntelliJ IDEA.|https://developer.android.com/studio/index.html|{{AUR|android-studio}}}}<br />
* {{App|[[Wikipedia:Anjuta|Anjuta]]|Versatile IDE with project management, an application wizard, an interactive debugger, a source editor, version control support and many more tools.|https://anjuta.org/|{{AUR|anjuta}}}}<br />
* {{App|[[Wikipedia:Aptana#Aptana_Studio|Aptana Studio]]|IDE based on Eclipse, but geared towards web development, with support for HTML, CSS, Javascript, Ruby on Rails, PHP, Adobe AIR and others.|http://www.aptana.com/|{{AUR|aptana-studio}}}}<br />
* {{App|[[Wikipedia:Bluefish (software)|Bluefish]]|Powerful editor targeted towards programmers and webdevelopers, with many options to write websites, scripts and programming code. It supports many programming and markup languages.|https://bluefish.openoffice.nl/|{{Pkg|bluefish}}}}<br />
* {{App|[[Wikipedia:Code::Blocks|Code::Blocks]]|C, C++ and Fortran IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable.|https://codeblocks.org/|{{Pkg|codeblocks}}}}<br />
* {{App|[[Wikipedia:JetBrains#CLion|CLion]]|A cross-platform IDE for C and C++.|https://www.jetbrains.com/clion/|{{AUR|clion}}}}<br />
* {{App|[[Wikipedia:CodeLite|CodeLite]]|Open source and cross-platform C/C++/PHP and Node.js IDE written in C++ .|https://codelite.org/|{{AUR|codelite}}}}<br />
* {{App|[[Eclipse]]|IDE for Java, C/C++, PHP, Perl and Python with subversion support and task management.|https://www.eclipse.org/|Java EE: {{AUR|eclipse-jee}}, Java: {{AUR|eclipse-java}}, RCP: {{AUR|eclipse-rcp}}, C/C++: {{AUR|eclipse-cpp}}, PHP: {{AUR|eclipse-php}}, JavaScript and Web: {{AUR|eclipse-dltk-javascript}}}}<br />
* {{App|[[Wikipedia:Eric (software)|Eric]]|Full-featured Python and Ruby IDE written in PyQt5.|https://eric-ide.python-projects.org/|{{AUR|eric}}}}<br />
* {{App|[[Gambas]]|IDE based on a Basic interpreter with object extensions.|https://gambas.sourceforge.net/en/main.html|{{Pkg|gambas3-ide}}}}<br />
* {{App|[[Wikipedia:Geany|Geany]]|Small and lightweight IDE with many supported many programming and markup languages including C, Java, PHP, HTML, Python, Perl, Pascal.|https://geany.org/|{{Pkg|geany}}}}<br />
* {{App|[[Wikipedia:GNOME Builder|GNOME Builder]]|Tool to write and contribute to great GNOME-based applications.|https://wiki.gnome.org/Apps/Builder|{{Pkg|gnome-builder}}}}<br />
* {{App|[[Wikipedia:KDevelop|KDevelop]]|Feature-full, plugin extensible IDE for C/C++ and other programming languages.|https://www.kdevelop.org/|{{Pkg|kdevelop}}}}<br />
* {{App|[[Wikipedia:Komodo_Edit|Komodo Edit]]|A free, multi-language editor.|https://www.activestate.com/products/komodo-edit/|{{AUR|komodo-edit}}}}<br />
* {{App|Lapce|Lightning-fast and Powerful Code Editor written in Rust.|https://lapce.dev/|{{Pkg|lapce}}}}<br />
* {{App|[[Wikipedia:Lazarus (IDE)|Lazarus]]|Delphi (Object Pascal) compatible IDE for Rapid Application Development. It has variety of components ready for use and a graphical form designer to easily create complex graphical user interfaces.|https://www.lazarus-ide.org/|{{Pkg|lazarus}}}}<br />
* {{App|LiteIDE|Simple Go IDE.|https://github.com/visualfc/liteide|{{Pkg|liteide}}}}<br />
* {{App|Lite XL|A lightweight, simple, fast, feature-filled, and extremely extensible text editor written in C, and Lua, adapted from lite.|https://lite-xl.com/|{{AUR|lite-xl}}}}<br />
* {{App|[[Wikipedia:MPLAB|MPLAB]]|IDE for Microchip PIC and dsPIC development.|https://www.microchip.com/mplabx|{{AUR|microchip-mplabx-bin}}}}<br />
* {{App|[[Netbeans]]|IDE for developing with Java, JavaScript, PHP, Python, Ruby, Groovy, C, C++, Scala, Clojure, and other languages.|https://netbeans.org/|{{Pkg|netbeans}}}}<br />
* {{App|[[Wikipedia:PhpStorm|PhpStorm]]|JetBrains PhpStorm is a commercial, cross-platform IDE for PHP built on JetBrains' IntelliJ IDEA platform, providing an editor for PHP, HTML and JavaScript with on-the-fly code analysis, error prevention and automated refactorings for PHP and JavaScript code.|https://www.jetbrains.com/phpstorm/|{{AUR|phpstorm}}, {{AUR|phpstorm-eap}}}}<br />
* {{App|[[Wikipedia:Qt Creator|Qt Creator]]|Lightweight, cross-platform C++ integrated development environment with a focus on Qt.|https://www.qt.io/ide/|{{Pkg|qtcreator}}}}<br />
* {{App|[[Wikipedia:Eclipse Theia|Theia]]|Eclipse Theia is a free and open-source IDE for desktop and web applications. It is implemented in TypeScript, is based on Visual Studio Code, and emphasizes extensibility. It can be run as a web or a desktop application.|https://theia-ide.org/|{{AUR|theia-electron}}}}<br />
* {{App|[[Visual Studio Code]]|Visual Studio Code is a cross-platform, free and open-source text editor developed by Microsoft, written in JavaScript and TypeScript. It supports a variety of languages thanks to its extensions.|https://code.visualstudio.com/|{{Pkg|code}}, {{AUR|visual-studio-code-bin}}}}<br />
* {{App|[[Visual Studio Code|VSCodium]]|Free/Libre Open Source Software Binaries of VSCode.|https://vscodium.com/|{{AUR|vscodium}}}}<br />
* {{App|[[Wikipedia:ZeroBrane Studio|ZeroBrane Studio]]|IDE with debugging support for Lua 5.1, Lua 5.2, Lua 5.3, LuaJIT, and other Lua engines.|https://studio.zerobrane.com/|{{AUR|zerobrane-studio}}}}<br />
<br />
===== Java IDEs =====<br />
<br />
* {{App|[[Wikipedia:BlueJ|BlueJ]]|Fully featured Java IDE used mainly for educational and beginner purposes.|https://bluej.org/|{{AUR|bluej}}}}<br />
* {{App|[[Wikipedia:IntelliJ IDEA|IntelliJ IDEA]]|IDE for Java, Groovy and other programming languages with advanced refactoring features.|https://www.jetbrains.com/idea/|{{Pkg|intellij-idea-community-edition}}}}<br />
<br />
===== Python IDEs =====<br />
<br />
* {{App|[[Wikipedia:Ninja-IDE|Ninja-IDE]]|IDE for Python development.|https://ninja-ide.org/|{{AUR|ninja-ide}}}}<br />
* {{App|[[Wikipedia:PyCharm|PyCharm]]|Python IDE with support for code analysis, debugging, unit testing, version control and web development with Django.|https://www.jetbrains.com/pycharm/|community edition: {{Pkg|pycharm-community-edition}}, professional edition: {{AUR|pycharm-professional}}, edu edition: {{AUR|pycharm-edu}}}}<br />
* {{App|[[Wikipedia:Spyder (software)|Spyder]]|Scientific Python Development Environment providing MATLAB-like features.|https://github.com/spyder-ide/spyder|{{Pkg|spyder}}}}<br />
* {{App|[[Wikipedia:Thonny|Thonny]]|Python IDE for beginners.|https://thonny.org/|{{AUR|thonny}}}}<br />
* {{App|[[Wikipedia:Wing IDE|WingIDE]]|Proprietary Python development environment. It is fully featured and meant for professional use.|https://wingware.com/|{{AUR|wingide}}}}<br />
<br />
===== Educational IDEs =====<br />
<br />
* {{App|KTurtle|Educational programming environment that aims to make learning how to program as easily as possible. Part of {{Grp|kde-education}}.|https://apps.kde.org/kturtle/|{{Pkg|kturtle}}}}<br />
* {{App|[[Wikipedia:Processing (programming language)|Processing]]|Playground for teaching non-programmers the fundamentals of computer programming in a visual context.|https://processing.org/|{{AUR|processing}}}}<br />
* {{App|[[Wikipedia:Scratch (programming language)|Scratch]]|Programming system and content development tool for educational and entertainment purposes, such as creating interactive projects and simple sprite-based games. It is used primarly by unskilled users (such as children) as an entry to [[Wikipedia:Event-driven_programming|event-driven programming]].|https://scratch.mit.edu/|{{Pkg|scratch}}}}<br />
<br />
==== Debuggers ====<br />
<br />
* {{App|Accerciser|Interactive Python accessibility explorer. It uses the AT-SPI library to inspect, examine, and interact with widgets, allowing you to check if an application is providing correct information to assistive technologies and automated testing frameworks.|https://wiki.gnome.org/Apps/Accerciser|{{Pkg|accerciser}}}}<br />
* {{App|Bustle|Draws sequence diagrams of D-Bus activity. It shows signal emissions, method calls and their corresponding returns, with time stamps for each individual event and the duration of each method call.|https://www.freedesktop.org/wiki/Software/Bustle/|{{AUR|bustle-git}}}}<br />
* {{App|[[Wikipedia:Data Display Debugger|Data Display Debugger]]|Graphical front-end for command-line debuggers such as GDB.|https://www.gnu.org/software/ddd/|{{AUR|ddd}}}}<br />
* {{App|Desed|TUI-based debugger for sed. Features variable and regex preview, setting breakpoints and stepping back and forth.|https://github.com/SoptikHa2/desed|{{AUR|desed}}}}<br />
* {{App|D-Feet|Easy to use D-Bus debugger to inspect D-Bus interfaces of running programs and invoke methods on those interfaces.|https://wiki.gnome.org/Apps/DFeet|{{Pkg|d-feet}}}}<br />
* {{App|GammaRay|Qt-application inspection and manipulation tool.|https://www.kdab.com/development-resources/qt-tools/gammaray/|{{Pkg|gammaray}}}}<br />
* {{App|GDBFrontend|Easy, flexible and extensible graphical debugger.|https://github.com/rohanrhu/gdb-frontend|{{AUR|gdb-frontend-bin}}}}<br />
* {{App|KCachegrind|Profile data visualization tool, used to determine the most time consuming execution parts of program.|https://apps.kde.org/kcachegrind/|KDE: {{Pkg|kcachegrind}}, Qt: {{Pkg|qcachegrind}}}}<br />
* {{App|KDbg|Graphical user interface to GDB, the GNU debugger. It provides an intuitive interface for setting breakpoints, inspecting variables, and stepping through code.|https://www.kdbg.org/|{{Pkg|kdbg}}}}<br />
* {{App|Massif-Visualizer|Visualizer for Valgrind Massif data files.|https://apps.kde.org/massif-visualizer/|{{Pkg|massif-visualizer}}}}<br />
* {{App|[[Wikipedia:Nemiver|Nemiver]]|Easy to use standalone C/C++ debugger (GDB front-end) that integrates well in the GNOME environment.|https://wiki.gnome.org/Apps/Nemiver|{{AUR|nemiver}}}}<br />
* {{App|Qt QDbusViewer|Tool to introspect D-Bus objects and messages.|https://doc.qt.io/qt-5/qdbusviewer.html|{{Pkg|qt5-tools}}}}<br />
* {{App|scanmem|Debugging utility designed to isolate the address of an arbitrary variable in an executing process.|https://github.com/scanmem/scanmem|CLI: {{Pkg|scanmem}}, GUI: {{Pkg|gameconqueror}}}}<br />
* {{App|Sysprof|Profiling tool that helps in finding the functions in which a program uses most of its time.|https://wiki.gnome.org/Apps/Sysprof|{{Pkg|sysprof}}}}<br />
<br />
==== Lexing and parsing ====<br />
<br />
[[Wikipedia:Lex (software)|Lex]] and [[Wikipedia:Yacc|Yacc]] are part of POSIX.<br />
<br />
* {{App|[[Wikipedia:Flex (lexical analyser generator)|flex]]|A tool for generating text-scanning programs, alternative to Lex.|https://github.com/westes/flex|{{Pkg|flex}}}}<br />
* {{App|[[Wikipedia:Berkeley Yacc|Berkeley Yacc]]|Berkeley reimplementation of the Unix parser generator Yacc.|https://invisible-island.net/byacc/|{{Pkg|byacc}}}}<br />
* {{App|[[Wikipedia:GNU bison|GNU Bison]]|The GNU general-purpose parser generator, alternative to ''byacc''.|https://www.gnu.org/software/bison/|{{Pkg|bison}}}}<br />
<br />
And then there are also:<br />
<br />
* {{App|[[Wikipedia:ANTLR|ANTLR]]|Parser generator, written in Java, for parsing structured text or binary files.|https://www.antlr.org/|{{Pkg|antlr4}}}}<br />
* {{App|LPeg|Pattern-matching library, based on PEGs, for Lua.|http://www.inf.puc-rio.br/~roberto/lpeg/|{{Pkg|lua-lpeg}}, {{Pkg|lua52-lpeg}}, {{Pkg|lua51-lpeg}}}}<br />
* {{App|peg/leg|Recursive-descent parser generators for C.|https://www.piumarta.com/software/peg/|{{Pkg|peg}}}}<br />
* {{App|Ragel|Compiles finite state machines from regular languages into executable C, C++, Objective-C, or D code.|https://www.colm.net/open-source/ragel/|{{Pkg|ragel}}}}<br />
<br />
==== GUI builders ====<br />
<br />
* {{App|[[Wikipedia:FLUID|FLUID]]|FLTK GUI designer.|https://www.fltk.org/|{{Pkg|fltk}}}}<br />
* {{App|[[Wikipedia:Glade Interface Designer|Glade]]|Create or open user interface designs for GTK applications.|https://glade.gnome.org/|{{Pkg|glade}}}}<br />
* {{App|KUIViewer|Quick viewer for Qt Designer UI File.|https://apps.kde.org/kuiviewer/|{{Pkg|kde-dev-utils}}}}<br />
* {{App|Qt Designer|Tool for designing and building graphical user interfaces (GUIs) with Qt Widgets.|https://doc.qt.io/qt-5/qtdesigner-manual.html|{{Pkg|qt5-tools}}}}<br />
<br />
==== Hex editors ====<br />
<br />
See also [[Wikipedia:Comparison of hex editors]].<br />
<br />
* {{App|Bless|High quality, full featured hex editor.|https://web.archive.org/web/20170503150524/http://home.gna.org/bless/|{{Pkg|bless}}}}<br />
* {{App|GHex|Hex editor for GNOME, which allows the user to load data from any file, view and edit it in either hex or ascii.|https://wiki.gnome.org/Apps/Ghex|{{Pkg|ghex}}}}<br />
* {{App|hyx|A minimalistic (< 2300 lines of C) but powerful (hex/ASCII, insert/replace/delete, copy/paste, undo/redo, search, colors, vim-inspired controls) Linux terminal hex editor.|https://yx7.cc/code/|{{AUR|hyx}}}}<br />
* {{App|ImHex|A hex editor for reverse engineers, programmers, and people who value their retinas when working at 3 AM.|https://imhex.werwolv.net/|{{AUR|imhex}}}}<br />
* {{App|Okteta|KDE hex editor for viewing and editing the raw data of files.|https://apps.kde.org/okteta/|{{Pkg|okteta}}}}<br />
* {{App|Reverse Engineer's Hex Editor|Hex editor with features for analyzing and annotating binary file formats|https://github.com/solemnwarning/rehex|{{AUR|rehex}}}}<br />
* {{App|wxHexEditor|Hex editor for large files with advanced features such as raw memory and disk editing capabilities.|https://www.wxhexeditor.org/|{{AUR|wxhexeditor}}}}<br />
<br />
==== JSON tools ====<br />
<br />
* {{App|gron|gron transforms JSON into discrete assignments to make it easier to grep.|https://github.com/tomnomnom/gron|{{Pkg|gron}}}}<br />
* {{App|jid|JSON incremental digger|https://github.com/simeji/jid|{{AUR|jid}}}}<br />
* {{App|jo|A command to create JSON.|https://github.com/jpmens/jo|{{AUR|jo-git}}}}<br />
* {{App|jq|Command-line JSON processor|https://stedolan.github.io/jq/|{{Pkg|jq}}}}<br />
* {{App|jshon|A JSON parser for the shell.|http://kmkeen.com/jshon/|{{Pkg|jshon}}}}<br />
* the [[Elvish]] shell has built-in support for JSON<br />
<br />
==== Literate programming ====<br />
<br />
See also [[Wikipedia:Literate programming]].<br />
<br />
* {{App|Noweb|A Simple, Extensible Tool for Literate Programming build against ICON libs and texlive|https://www.cs.tufts.edu/~nr/noweb/|{{AUR|noweb}}}}<br />
* {{App|nuweb|A Simple Literate Programming Tool|http://nuweb.sourceforge.net/|{{AUR|nuweb}}}}<br />
<br />
==== UML modelers ====<br />
<br />
See also [[Wikipedia:List of Unified Modeling Language tools]].<br />
<br />
* {{App|[[Wikipedia:ArgoUML|ArgoUML]]|UML modeling tool with support for all standard UML 1.4 diagrams.|https://argouml-tigris-org.github.io/|{{AUR|argouml}}}}<br />
* {{App|[[Eclipse]] Modeling Tools|Tools and runtimes for building model-based applications.|https://www.eclipse.org/|{{AUR|eclipse-modeling-tools}}}}<br />
* {{App|Gaphor|Simple modeling tool for UML.|https://github.com/gaphor/gaphor|{{AUR|python-gaphor}}}}<br />
* {{App|[[Wikipedia:Modelio|Modelio]]|Modeling environment supporting the main standards: UML, BPMN, MDA, SysML.|https://www.modelio.org/|{{AUR|modelio-bin}}}}<br />
* {{App|[[Wikipedia:Papyrus (software)|Papyrus]]|Model-based engineering tool based on Eclipse.|https://www.eclipse.org/papyrus/|{{AUR|papyrus}}}}<br />
* {{App|[[Wikipedia:PlantUML|PlantUML]]|Tool to create UML diagrams from a plain text language.|https://plantuml.com|{{Pkg|plantuml}}}}<br />
* {{App|PlantUML QEditor|PlantUML editor written in Qt.|https://github.com/borco/plantumlqeditor|{{AUR|plantumlqeditor-git}}}}<br />
* {{App|[[Wikipedia:Umbrello UML Modeller|Umbrello]]|Unified Modelling Language (UML) diagram program based on KDE Technology.|https://umbrello.kde.org/|{{Pkg|umbrello}}}}<br />
* {{App|[[Wikipedia:UML Designer|UML Designer]]|Graphical tool based on Eclipse to edit and visualize UML models.|https://www.umldesigner.org/|{{AUR|umldesigner}}}}<br />
* {{App|[[Wikipedia:UMLet|UMLet]]|UML tool with a simple user interface: draw UML diagrams fast, build sequence and activity diagrams from plain text, export diagrams to eps, pdf, jpg, svg, and clipboard, share diagrams using Eclipse, and create new, custom UML elements.|https://umlet.com/|{{AUR|umlet}}}}<br />
* {{App|UML/INTERLIS-editor|Facilitate the application of the model driven approach to a greater number of users.|http://www.umleditor.org/|{{AUR|umleditor}}}}<br />
* {{App|Violet|Very easy to learn and use UML editor that draws nice-looking diagrams.|https://sourceforge.net/projects/violet/|{{AUR|violetumleditor}}}}<br />
<br />
==== API documentation browsers ====<br />
<br />
* {{App|[[Wikipedia:GNOME Devhelp|Devhelp]]|Developer tool for browsing and searching API documentation.|https://wiki.gnome.org/Apps/Devhelp|{{Pkg|devhelp}}}}<br />
* {{App|Doc Browser|API documentation browser with support for DevDocs and Hoogle.|https://github.com/qwfy/doc-browser|{{AUR|doc-browser-git}}}}<br />
* {{App|Qt Assistant|Tool for viewing on-line documentation in Qt help file format.|https://doc.qt.io/qt-5/qtassistant-index.html|{{Pkg|qt5-tools}}}}<br />
* {{App|quickDocs|Fast developer docs reader for reading Valadoc and DevDocs.|https://github.com/mdh34/quickDocs|{{AUR|quickdocs}}}}<br />
* {{App|Zeal|Offline API documentation browser for software developers.|https://zealdocs.org/|{{AUR|zeal}}}}<br />
<br />
==== Issue tracking systems ====<br />
<br />
* {{App|[[Bugzilla]]|Bug tracker from Mozilla.|https://www.bugzilla.org|{{Pkg|bugzilla}}}}<br />
* {{App|[[Flyspray]]|Lightweight, web-based bug tracking system written in PHP|https://www.flyspray.org/|{{Pkg|flyspray}}}}<br />
* {{App|[[MantisBT]]|Web-based issue tracking system|https://www.mantisbt.org/|{{AUR|mantisbt}}}}<br />
* {{App|[[Redmine]]|A flexible project management web application. Written using the Ruby on Rails, it is cross-platform and cross-database.|https://www.redmine.org|{{Pkg|redmine}}}}<br />
* {{App|[[Trac]]|Trac Integrated SCM & Project Management using Apache & Subversion.|https://trac.edgewall.org/|{{AUR|trac}}}}<br />
<br />
See also [[Git server#Advanced web applications]].<br />
<br />
==== Code review ====<br />
<br />
* {{App|Gerrit|A web-based code review tool built on top of the Git version control system|https://www.gerritcodereview.com/|{{AUR|gerrit}}}}<br />
* [[GitLab]] also supports code reviews.<br />
<br />
See also [[Wikipedia:List of tools for code review]].<br />
<br />
==== Game development ====<br />
<br />
See also [[Wikipedia:List of game engines]].<br />
<br />
* {{App|[[Allegro]]|A cross-platform library mainly aimed at video game and multimedia programming. |https://liballeg.org/|{{Pkg|allegro}}}}<br />
* {{App|GDevelop|Game creator designed to be used by everyone - no programming skills required.|https://gdevelop-app.com/|{{AUR|gdevelop}}}}<br />
* {{App|[[Godot]]|Advanced, feature-packed, multi-platform 2D and 3D game engine. Create games with ease, using Godot's unique approach to game development.|https://godotengine.org/|{{Pkg|godot}}}}<br />
* {{App|LibreSprite|Animated sprite editor and pixel art tool lets you create 2D animations for videogames.|https://github.com/LibreSprite/LibreSprite|{{AUR|libresprite}}}}<br />
* {{App|LÖVE|Lua based game development environment.|https://love2d.org/|{{Pkg|love}}}}<br />
* {{App|Pixelorama|2D sprite editor with animation support, made by Orama Interactive in the Godot Engine using GDScript.|https://orama-interactive.itch.io/pixelorama|{{AUR|pixelorama-bin}}}}<br />
* {{App|TIC-80|Fantasy computer/console.|https://tic80.com/|{{AUR|tic-80-git}}}}<br />
* {{App|Tiled|General purpose 2D level editor with powerful tile map editing features. It is built to be easy to use and is suitable for many type of games.|https://www.mapeditor.org/|{{Pkg|tiled}}}}<br />
* {{App|[[Unity3D|Unity]]|Unity is a flexible and powerful development platform for creating multi-platform 3D and 2D games. Proprietary, but a free version is available for certain use-cases (see [https://store.unity.com/compare-plans here] for more details).|https://unity3d.com/unity|{{AUR|unityhub}}}}<br />
<br />
==== Repository managers ====<br />
<br />
{{Style|Redirects to company blogs should not be here.}}<br />
<br />
* {{App|Nexus 2|Nexus 2 Repository Manager (OSS)|https://www.sonatype.com/nexus-repository-oss|{{AUR|nexus}}}}<br />
* {{App|Nexus 3|Nexus 3 Repository OSS|https://www.sonatype.com/nexus-repository-oss|{{AUR|nexus-oss}}}}<br />
* {{App|Artifactory|Artifactory is an advanced Binary Repository Manager for use by build tools, dependency management tools and build servers|https://bintray.com/jfrog/product/JFrog-Artifactory-Oss/view|{{AUR|artifactory-oss}}}}<br />
<br />
=== Text input ===<br />
<br />
==== Character selectors ====<br />
<br />
* {{App|emote|A modern emoji picker written in GTK3.|https://github.com/tom-james-watson/Emote|{{AUR|emote}}}}<br />
* {{App|GNOME Characters|Character map application for GNOME.|https://gitlab.gnome.org/GNOME/gnome-characters|{{Pkg|gnome-characters}}}}<br />
* {{App|[[Wikipedia:GNOME Character Map|gucharmap]]|GTK 3 character selector for GNOME.|https://wiki.gnome.org/Apps/Gucharmap|{{Pkg|gucharmap}}}}<br />
* {{App|KCharSelect|Tool to select special characters from all installed fonts and copy them into the clipboard. Part of {{Grp|kde-utilities}}.|https://apps.kde.org/kcharselect/|{{Pkg|kcharselect}}}}<br />
<br />
==== On-screen keyboards ====<br />
<br />
* {{App|CellWriter|Grid-entry handwriting recognition input panel.|https://github.com/risujin/cellwriter|{{AUR|cellwriter}}}}<br />
* {{App|CoreKeyboard|Simple X11 based Qt virtual keyboard with word suggestions. Part of C-Suite.|https://cubocore.org/|{{AUR|corekeyboard}}}}<br />
* {{App|eekboard|Easy to use virtual keyboard toolkit.|https://github.com/ueno/eekboard|{{AUR|eekboard}}}}<br />
* {{App|Florence|Extensible scalable on-screen virtual keyboard for GNOME that stays out of your way when not needed.|https://sourceforge.net/projects/florence/|{{AUR|florence}}}}<br />
* {{App|Maliit Keyboard|Virtual keyboard useful for KDE Plasma-Wayland|https://maliit.github.io/|{{Pkg|maliit-keyboard}}}}<br />
* {{App|Onboard|Onscreen keyboard useful for tablet PC users and for mobility impaired users.|https://launchpad.net/onboard|{{Pkg|onboard}}}}<br />
* {{App|qtvkbd|Virtual keyboard written in Qt, a fork of kvkbd.|https://github.com/Alexander-r/qtvkbd|{{AUR|qtvkbd}}}}<br />
* {{App|QVKbd|Virtual keyboard written in Qt.|https://github.com/KivApple/qvkbd|{{Pkg|qvkbd}}}}<br />
* {{App|Squeekboard|GTK 3 virtual keyboard for [[Wayland]], written in Rust/C.|https://gitlab.gnome.org/World/Phosh/squeekboard|{{AUR|squeekboard}}}}<br />
* {{App|theShell On Screen Keyboard|Touchscreen keyboard for theShell.|https://github.com/vicr123/ts-kbd|{{AUR|ts-kbd}}}}<br />
* {{App|xvkbd|Virtual keyboard for X window system.|http://t-sato.in.coocan.jp/xvkbd/|{{AUR|xvkbd}}}}<br />
<br />
==== Keyboard layout switchers ====<br />
<br />
* {{App|fbxkb|A NETWM compliant keyboard indicator and switcher. It shows a flag of current keyboard in a systray area and allows you to switch to another one.|http://fbxkb.sourceforge.net/|{{AUR|fbxkb}}}}<br />
* {{App|xxkb|A lightweight keyboard layout indicator and switcher.|https://sourceforge.net/projects/xxkb/|{{Pkg|xxkb}}}}<br />
* {{App|gxkb|X11 keyboard layout indicator and switcher.|https://github.com/zen-tools/gxkb|{{Pkg|gxkb}}}}<br />
* {{App|qxkb|A keyboard switcher written in Qt.|https://github.com/disels/qxkb|{{AUR|qxkb}}}}<br />
* {{App|[[Wikipedia:X Neural Switcher|X Neural Switcher]]|A text analyser, it detects the language of the input and corrects the keyboard layout if needed.|https://xneur.ru/|{{AUR|gxneur}}}}<br />
<br />
==== Keybinding managers ====<br />
<br />
See [[Keyboard shortcuts#Xorg]].<br />
<br />
==== Input methods ====<br />
<br />
See the main article: [[Input method]].<br />
<br />
=== Disks ===<br />
<br />
==== Partitioning tools ====<br />
<br />
See [[Partitioning#Partitioning tools]].<br />
<br />
==== Formatting tools ====<br />
<br />
See [[File systems#Types of file systems]].<br />
<br />
==== Cloning tools ====<br />
<br />
See [[Disk cloning]].<br />
<br />
==== Mount tools ====<br />
<br />
See also [[udisks#Mount helpers]].<br />
<br />
* {{App|9mount|Mount 9p filesystems.|http://sqweek.net/code/9mount/|{{AUR|9mount}}}}<br />
* {{App|cryptmount|Mount an encrypted file system as a regular user.|https://sourceforge.net/projects/cryptmount/|{{AUR|cryptmount}}}}<br />
* {{App|KDiskFree|Displays information about hard disks and other storage devices. It also allows to mount and unmount drives and view them in a file manager.|https://apps.kde.org/kdf/|{{Pkg|kdf}}}}<br />
* {{App|ldm|A lightweight daemon that mounts drives automagically using ''udev''|https://github.com/LemonBoy/ldm|{{AUR|ldm}}}}<br />
* {{App|pmount|Mount ''source'' as a regular user to an automatically created destination {{ic|/media/''source_name''}}.|[[Debian:pmount]]|{{AUR|pmount}}}}<br />
* {{App|pmount-safe-removal|Mount removable devices as regular user with safe removal|https://mywaytoarch.tumblr.com/post/13111098534/pmount-safe-removal-of-usb-device|{{AUR|pmount-safe-removal}}}}<br />
* {{App|udevil|Mounts removable devices as a regular user, show device info, and monitor device changes. Only depends on ''udev'' and glib.|https://ignorantguru.github.io/udevil|{{AUR|udevil}}}}<br />
* {{App|ws|Mount Windows network shares ([[Wikipedia:Server Message Block|CIFS]] and [[Wikipedia:Virtual file system|VFS]]).|https://sourceforge.net/projects/winshares/|{{AUR|ws}}}}<br />
* {{App|zulucrypt|A GUI frontend for cryptsetup to create, manage and mount encrypted volumes; supports encfs as well|https://mhogomchungu.github.io/zuluCrypt/|{{AUR|zulucrypt}}}}<br />
<br />
==== Disk usage display ====<br />
<br />
===== Console =====<br />
<br />
* {{App|duc|A library and suite of tools for inspecting disk usage.|https://duc.zevv.nl/|{{AUR|duc}}}}<br />
* {{App|dust|A more intuitive version of du in rust.|https://github.com/bootandy/dust|{{Pkg|dust}}}}<br />
* {{App|gdu|Disk usage analyzer with console interface written in Go.|https://github.com/Dundee/gdu|{{Pkg|gdu}}}}<br />
* {{App|gt5|Diff-capable "du-browser".|http://gt5.sourceforge.net|{{AUR|gt5}}}}<br />
* {{App|ncdu|Simple ncurses disk usage analyzer.|https://dev.yorhel.nl/ncdu|{{Pkg|ncdu}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|[[Wikipedia:Filelight|Filelight]]|Disk usage analyzer that creates an interactive map of concentric, segmented rings that help visualise disk usage on your computer.|https://apps.kde.org/filelight/|{{Pkg|filelight}}}}<br />
* {{App|[[Wikipedia:Disk Usage Analyzer|GNOME Disk Usage Analyzer]]|Disk usage analyzer for the [[GNOME]] desktop to check folder sizes and available disk space.|https://wiki.gnome.org/Apps/DiskUsageAnalyzer|{{Pkg|baobab}}}}<br />
* {{App|Graphical Disk Map|Disk usage analyzer that draws a map of rectangles sized according to file or dir sizes.|http://gdmap.sourceforge.net/|{{AUR|gdmap}}}}<br />
* {{App|fsview (part of Konqueror)|KDE based disk usage analyzer that draws a map of rectangles sized according to file or dir sizes.|https://docs.kde.org/trunk5/en/konqueror/konqueror/view-extensions.html|{{Pkg|konqueror}}}}<br />
* {{App|MATE Disk Usage Analyzer|Disk usage analyzing tool for MATE Desktop.|https://github.com/mate-desktop/mate-utils|{{Pkg|mate-utils}}}}<br />
* {{App|qdirstat|Qt-based directory statistics (KDirStat/K4DirStat without any KDE - from the original KDirStat author).|https://github.com/shundhammer/qdirstat|{{AUR|qdirstat}}}}<br />
<br />
==== Disk health status ====<br />
<br />
See [[S.M.A.R.T.#GUI applications]].<br />
<br />
==== File recovery tools ====<br />
<br />
See [[File recovery#List of utilities]].<br />
<br />
==== Disk cleaning ====<br />
<br />
===== Console =====<br />
<br />
* {{App|Czkawka CLI|Simple, fast and free app to remove unnecessary files from your computer.|https://github.com/qarmin/czkawka|{{AUR|czkawka-cli}}}}<br />
* {{App|duff|A command-line utility for quickly finding duplicates in a given set of files.|https://github.com/elmindreda/duff|{{AUR|duff}}}}<br />
* {{App|fclones|Very fast duplicate file Finder written in rust.|https://github.com/pkolaczk/fclones|{{AUR|fclones}}}}<br />
* {{App|[[Wikipedia:fdupes|fdupes]]|Program for identifying or deleting duplicate files residing within specified directories.|https://github.com/adrianlopezroche/fdupes|{{Pkg|fdupes}}}}<br />
* {{App|jdupes|Identify and take actions upon duplicate files.|https://github.com/jbruchon/jdupes|{{AUR|jdupes}}}}<br />
* {{App|rdfind|Command line tool that finds duplicate files. It compares files based on their content.|https://github.com/pauldreik/rdfind|{{AUR|rdfind}}}}<br />
* {{App|rmlint|Tool to quickly find (and optionally remove) duplicate files and other lint.|https://github.com/sahib/rmlint|{{Pkg|rmlint}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|[[Wikipedia:BleachBit|BleachBit]]|Frees disk space and guards your privacy; frees cache, deletes cookies, clears Internet history, shreds temporary files, deletes logs, and discards junk you did not know was there.|https://www.bleachbit.org/|{{Pkg|bleachbit}}}}<br />
* {{App|Czkawka GUI|Simple, fast and free app to remove unnecessary files from your computer. Looks similar to FSlint.|https://github.com/qarmin/czkawka|{{AUR|czkawka-gui}}}}<br />
* {{App|dupeGuru|GUI tool to find duplicate files in a system.|https://dupeguru.voltaicideas.net/|{{AUR|dupeguru}}}}<br />
* {{App|FSlint|A utility to find and clean various forms of lint on a filesystem.|https://www.pixelbeat.org/fslint/|{{AUR|fslint}}}}<br />
* {{App|GConf Cleaner|cleans up the unknown/invalid GConf keys that still sitting down on your GConf database.|https://code.google.com/archive/p/gconf-cleaner/|{{AUR|gconf-cleaner}}}}<br />
* {{App|Shredder|Graphical user interface for rmlint.|https://github.com/sahib/rmlint|{{Pkg|rmlint-shredder}}}}<br />
* {{App|Sweeper|System cleaning utility for KDE.|https://apps.kde.org/sweeper/|{{Pkg|sweeper}}}}<br />
<br />
==== Disk image writing ====<br />
<br />
See also [[Wikipedia:List of tools to create Live USB systems]].<br />
<br />
{{Warning|Some disk image writing tools are known to be [[Wikipedia:adware|adware]], for example [[USB flash installation medium#Using etcher|etcher]].}}<br />
* {{App|Bytewalk|Bytewalk is a firmware extraction tool and binwalk fork. |https://gitlab.com/bytesweep/bytewalk|{{AUR|bytewalk}}}}<br />
* {{App|Deepin Boot Maker|Tool to make boot disk for Deepin OS.|https://www.deepin.org/en/original/deepin-boot-maker/|{{Pkg|deepin-boot-maker}}}}<br />
* {{App|[[Wikipedia:Fedora Media Writer|Fedora Media Writer]]|Tool that helps users put Fedora images on their portable drives such as flash disks.|https://github.com/FedoraQt/MediaWriter|{{AUR|mediawriter}}}}<br />
* {{App|GNOME MultiWriter|Write an ISO file to multiple USB devices at once.|https://wiki.gnome.org/Apps/MultiWriter|{{Pkg|gnome-multi-writer}}}}<br />
* {{App|Image Burner|Simple imageburner designed for elementary OS.|https://github.com/artemanufrij/imageburner|{{AUR|imageburner}}}}<br />
* {{App|ISOImageWriter|Tool to write a .iso file to a USB disk.|https://community.kde.org/ISOImageWriter|{{AUR|isoimagewriter}}}}<br />
* {{App|LiveUSB Install|Install various Linux distributions and operating systems on removable flash drive or external disk drive.|http://live.learnfree.eu/|{{AUR|live-usb-install}}}}<br />
* {{App|MultiBootUSB|Install multiple live distributions on a USB disk non-destructively and has an option to uninstall them.|https://github.com/mbusb/multibootusb/|{{AUR|multibootusb}}}}<br />
* {{App|MultiSystem|GUI tool to create a USB system that can boot multiple distributions.|http://liveusb.info/|{{AUR|multisystem}}}}<br />
* {{App|Popsicle|Utility for flashing multiple USB devices in parallel, written in Rust.|https://github.com/pop-os/popsicle|{{AUR|popsicle}}}}<br />
* {{App|SUSE Studio ImageWriter|Utility for writing raw disk images & hybrid isos to USB keys.|https://github.com/openSUSE/imagewriter|{{AUR|imagewriter}}}}<br />
* {{App|[[Wikipedia:UNetbootin|UNetbootin]]|Installs Linux/BSD distributions to a partition or USB drive.|https://unetbootin.github.io/|{{AUR|unetbootin}}}}<br />
* {{App|Usbimager|Minimal GUI application to write compressed disk images to USB drives.|https://gitlab.com/bztsrc/usbimager|{{AUR|usbimager}}}}<br />
* {{App|WoeUSB|Simple tool to create USB stick windows installer from an ISO image or a real DVD. (Fork of WinUSB).|https://github.com/WoeUSB/WoeUSB|{{AUR|woeusb}}, {{AUR|woeusb-ng}}}}<br />
* {{App|windows2usb|Windows ISO to Flash Drive burning utility for Linux with MBR/GPT, BIOS/UEFI, FAT32/NTFS support|https://github.com/ValdikSS/windows2usb|{{AUR|windows2usb-git}}}}<br />
<br />
=== System ===<br />
<br />
==== Task managers ====<br />
<br />
* {{App|CoreStats|Simple lightweight system resource viewer to monitor the CPU, RAM, Network and Disk IO statistics. Part of C-Suite.|https://cubocore.org/|{{AUR|corestats}}}}<br />
* {{App|Deepin System Monitor|Monitor system process status for Deepin desktop.|https://www.deepin.org/en/original/deepin-system-monitor/|{{Pkg|deepin-system-monitor}}}}<br />
* {{App|GNOME System Monitor|System monitor for [[GNOME]] to view and manage system resources.|https://wiki.gnome.org/Apps/SystemMonitor|{{Pkg|gnome-system-monitor}}}}<br />
* {{App|GNOME Usage|View information about use of system resources, like memory and disk space.|https://wiki.gnome.org/Apps/Usage|{{Pkg|gnome-usage}}}}<br />
* {{App|[[Wikipedia:Htop|htop]]|Simple, ncurses interactive process viewer.|https://htop.dev/|{{Pkg|htop}}}}<br />
* {{App|bashtop|A Linux resource monitor written in bash.|https://github.com/aristocratos/bashtop|{{Pkg|bashtop}}}}<br />
* {{App|bpytop|Htop but more lightweight with more features.|https://github.com/aristocratos/bpytop|{{Pkg|bpytop}}}}<br />
* {{App|btop|Rewrite of bpytop in C++|https://github.com/aristocratos/btop|{{Pkg|btop}}}}<br />
* {{App|bottom|A cross-platform graphical process/system monitor.|https://github.com/ClementTsang/bottom|{{Pkg|bottom}}}}<br />
* {{App|gtop|A system monitoring dashboard for the terminal.|https://github.com/aksakalli/gtop|{{Pkg|gtop}}}}<br />
* {{App|[[Wikipedia:KDE System Guard|KSysGuard]]|System monitor for [[KDE]] to monitor running processes and system performance.|https://apps.kde.org/ksysguard/|{{Pkg|ksysguard}}}}<br />
* {{App|Linux Process Explorer|Graphical process explorer for Linux.|https://github.com/wolfc01/procexp|{{AUR|procexp}}}}<br />
* {{App|LXTask|Lightweight task manager for [[LXDE]].|https://wiki.lxde.org/en/LXTask{{Dead link|2022|09|20|status=404}}|{{Pkg|lxtask}}}}<br />
* {{App|qps|Lightweight task manager for [[LXQt]].|https://github.com/lxqt/qps|{{AUR|qps}}}}<br />
* {{App|MATE System Monitor|System monitor for [[MATE]].|https://github.com/mate-desktop/mate-system-monitor|{{Pkg|mate-system-monitor}}}}<br />
* {{App|Plasma System Monitor|Advanced and customizable system monitor for [[KDE]].|https://apps.kde.org/plasma-systemmonitor/|{{Pkg|plasma-systemmonitor}}}}<br />
* {{App|Stacer|System optimizer and application monitor that helps users to manage entire system with different aspects, its an all in one system utility.|https://oguzhaninan.github.io/Stacer-Web/|{{AUR|stacer}}}}<br />
* {{App|Task Manager|GTK2/GTK3 based process manager with basic system resource monitor for [[Xfce]].|https://goodies.xfce.org/projects/applications/xfce4-taskmanager|{{Pkg|xfce4-taskmanager}}}}<br />
<br />
==== System monitors ====<br />
<br />
See also [[:Category:Monitoring]].<br />
<br />
* {{App|[[Conky]]|Lightweight, scriptable system monitor.|https://github.com/brndnmtthws/conky|{{Pkg|conky}}}}<br />
* {{App|Collectd|Simple, extensible system monitoring daemon based on [https://oss.oetiker.ch/rrdtool/ rrdtool]. It has a small footprint and can be set up either stand-alone or as a server/client application.|https://collectd.org/|{{AUR|collectd}}}}<br />
* {{App|collectl|Collectl is a light-weight performance monitoring tool capable of reporting interactively as well as logging to disk. It reports statistics on cpu, disk, infiniband, lustre, memory, network, nfs, process, quadrics, slabs and more in easy to read format.|https://collectl.sourceforge.net/|{{AUR|collectl}}}}<br />
* {{App|CoreFreq|Low-level CPU monitor with BIOS like functionalities.|https://github.com/cyring/CoreFreq/|{{AUR|corefreq-client}}}}<br />
* {{App|dstat|Versatile resource statistics tool.|http://dag.wiee.rs/home-made/dstat/|{{Pkg|dstat}}}}<br />
* {{App|Fsniper|Daemon to run scripts based on changes in files monitored by inotify.|https://github.com/l3ib/fsniper|{{AUR|fsniper}}}}<br />
* {{App|[[Wikipedia:GKrellM|GKrellM]]|Simple, flexible system monitor package for [[GTK]] with many plug-ins.|https://billw2.github.io/gkrellm/gkrellm.html|{{Pkg|gkrellm}}}}<br />
* {{App|glances|CLI curses-based monitoring tool in Python.|https://nicolargo.github.io/glances/|{{Pkg|glances}}}}<br />
* {{App|hitome|A quick & dirty system monitor that's light on resources.|https://github.com/artefact2/hitome|{{AUR|hitome-git}}}}<br />
* {{App|kmon|Linux kernel manager and activity monitor.|https://github.com/orhun/kmon|{{Pkg|kmon}}}}<br />
* {{App|Nagstamon|Status monitor that connects to multiple Nagios, Icinga, Opsview, Centreon, Op5 Monitor/Ninja, Checkmk and Thruk monitoring servers.|https://github.com/orhun/kmon|{{AUR|nagstamon}}}}<br />
* {{App|netdata|Web-based real-time performance monitor.|https://github.com/firehol/netdata/wiki|{{Pkg|netdata}}}}<br />
* {{App|[[Telegraf]]|Agent written in Go for collecting, processing, aggregating, and writing metrics.|https://docs.influxdata.com/telegraf/latest/|{{AUR|telegraf}}}}<br />
* {{App|[[Paramano]]|Light battery monitor and a CPU frequency scaler. Forked from [http://trayfreq.sourceforge.net/ trayfreq]|https://github.com/phillid/paramano|{{AUR|paramano}}}}<br />
* {{app|Sysstat|Collection of resource monitoring tools: iostat, isag, mpstat, pidstat, sadf, sar.|http://sebastien.godard.pagesperso-orange.fr/|{{Pkg|sysstat}}}}<br />
* {{App|xosview|System monitor that resembles gr_osview from SGI IRIX.|https://www.pogo.org.uk/~mark/xosview/|{{AUR|xosview}}}}<br />
* {{App|zps|A small utility for listing and reaping zombie processes on GNU/Linux.|https://github.com/orhun/zps|{{Pkg|zps}}}}<br />
<br />
==== Hardware sensor monitoring ====<br />
<br />
See [[lm_sensors#Graphical front-ends]].<br />
<br />
==== System information viewers ====<br />
<br />
===== Console =====<br />
<br />
* {{App|alsi|A system information tool for Arch Linux. It can be configured for every other system without even touching the source code of the script.|https://trizenx.blogspot.com/2012/08/alsi.html|{{AUR|alsi}}}}<br />
* {{App|[[archey3]]|Python script to display system infomation alongside the Arch Linux logo.|https://lclarkmichalek.github.io/archey3|{{Pkg|archey3}}}}<br />
* {{App|dmidecode|It reports information about your system's hardware as described in your system BIOS according to the SMBIOS/DMI standard.|https://www.nongnu.org/dmidecode/|{{Pkg|dmidecode}}}}<br />
* {{App|hwdetect|Simple script to list modules that are exported in {{ic|/sys/}}.|https://github.com/archlinux/svntogit-packages/blob/packages/hwdetect/trunk/hwdetect|{{Pkg|hwdetect}}}}<br />
* {{App|hwinfo|Powerful hardware detection tool come from openSUSE.|https://github.com/openSUSE/hwinfo|{{Pkg|hwinfo}}}}<br />
* {{App|[[hw-probe]]|Tool to probe for hardware, check operability and find drivers with the help of [https://linux-hardware.org/ Linux Hardware Database].|https://github.com/linuxhw/hw-probe|{{AUR|hw-probe}}}}<br />
* {{App|inxi|A script to get system information.|https://github.com/smxi/inxi|{{Pkg|inxi}}}}<br />
* {{App|neofetch|A fast, highly customizable system info script that supports displaying images with w3m.|https://github.com/dylanaraps/neofetch|{{Pkg|neofetch}}}}<br />
* {{App|nmon|Console based application for monitoring various system components.|https://nmon.sourceforge.net/|{{Pkg|nmon}}}}<br />
* {{App|pfetch|A pretty system information tool written in POSIX sh.|https://github.com/dylanaraps/pfetch|{{AUR|pfetch}}}}<br />
* {{App|screenfetch|Similar to archey but has an option to take a screenshot. Written in bash.|https://github.com/KittyKatt/screenFetch|{{Pkg|screenfetch}}}}<br />
<br />
===== Graphical =====<br />
<br />
* {{App|GPU-Viewer|GUI to glxinfo, vulkaninfo, clinfo and es2_info; written in Python with GTK.|https://github.com/arunsivaramanneo/GPU-Viewer|{{AUR|gpu-viewer}}}}<br />
* {{App|hardinfo|A small application that displays information about your hardware and operating system, it looks like the Device Manager in Windows.|https://www.berlios.de/software/hardinfo/|{{AUR|hardinfo}}}}<br />
* {{App|i-Nex|An application that gathers information for hardware components available on your system and displays it using an user interface similar to the popular Windows tool CPU-Z.|http://i-nex.linux.pl/|{{AUR|i-nex-git}}}}<br />
* {{App|lshw|A small tool to provide detailed information on the hardware configuration of the machine with CLI and GTK interfaces.|https://ezix.org/project/wiki/HardwareLiSter|{{Pkg|lshw}}}}<br />
* {{App|[[Wikipedia:KInfoCenter|KInfoCenter]]|Centralized and convenient overview of system information for KDE.|https://userbase.kde.org/KInfoCenter|{{Pkg|kinfocenter}}}}<br />
* {{App|USBView|Display the topology of devices on the USB bus.|http://www.kroah.com/linux/usb/|{{Pkg|usbview}}}}<br />
<br />
==== System log viewers ====<br />
<br />
* {{App|GNOME Logs|Viewer for the systemd journal. Part of {{Grp|gnome}}.|https://wiki.gnome.org/Apps/Logs|{{Pkg|gnome-logs}}}}<br />
* {{App|KSystemLog|System log viewer tool for KDE.|https://apps.kde.org/ksystemlog/|{{Pkg|ksystemlog}}}}<br />
* {{App|MATE System Log|System log viewer for MATE.|https://github.com/mate-desktop/mate-utils|{{Pkg|mate-utils}}}}<br />
* {{App|Pacman Log Viewer|Tool used to inspect pacman log file, in particular it lists installed, removed and upgraded packages letting you to filter by package's name and/or date.|https://www.opendesktop.org/content/show.php?content&#61;150484|{{Pkg|pacmanlogviewer}}}}<br />
* {{App|QJournalctl|Qt-based graphical user interface for systemd's ''journalctl'' command.|https://github.com/pentix/qjournalctl|{{Pkg|qjournalctl}}}}<br />
<br />
==== Font viewers ====<br />
<br />
See also [[Wikipedia:Font management software]].<br />
* {{App|Deepin Font Manager|A font management tool for Deepin desktop.|https://www.deepin.org/en/original/deepin-font-manager/|{{Pkg|deepin-font-manager}}}}<br />
* {{App|Font Manager|Simple font management for GTK desktop environments.|https://fontmanager.github.io/|{{Pkg|font-manager}}}}<br />
* {{App|Fonty Python|Manage, view and find your fonts.|https://savannah.nongnu.org/projects/fontypython|{{AUR|fontypython}}}}<br />
* {{App|GNOME Fonts|Font viewer for GNOME.|https://gitlab.gnome.org/GNOME/gnome-font-viewer|{{Pkg|gnome-font-viewer}}}}<br />
* {{App|KFontview|KDE application to view and install different types of fonts.|https://kde.org/|{{Pkg|plasma-desktop}}}}<br />
* {{App|MATE Font Viewer|Font viewer for MATE.|https://github.com/mate-desktop/mate-control-center|{{Pkg|mate-utils}}}}<br />
<br />
==== Help viewers ====<br />
<br />
See [[man page#Installation]].<br />
<br />
==== Command schedulers ====<br />
<br />
See also [[Cron]].<br />
<br />
* {{App|FcronQ|Fcron GUI, an advanced periodic command scheduler.|http://fcronq.xavion.name/|{{AUR|fcronq}}}}<br />
* {{App|GNOME Schedule|Graphical interface to crontab and at for GNOME.|http://gnome-schedule.sourceforge.net/|{{AUR|gnome-schedule}}}}<br />
* {{App|KCron|Tool for KDE to run applications in the background at regular intervals. It is a graphical interface to the Cron command.|https://apps.kde.org/kcron/{{Dead link|2022|09|20|status=404}}|{{Pkg|kcron}}}}<br />
* {{App|KTimer|Little tool for KDE to execute programs after some time. It allows you to enter several tasks and to set a timer for each of them. The timers for each task can be started, stopped, changed, or looped.|https://apps.kde.org/ktimer/|{{Pkg|ktimer}}}}<br />
<br />
==== Shutdown timers ====<br />
<br />
* {{App|GShutdown|Advanced shutdown utility which allows you to schedule the shutdown or the restart of your computer, or logout your actual session.|https://gshutdown.tuxfamily.org/|{{AUR|gshutdown}}}}<br />
* {{App|Hsiu-Ming's Timer|Graphical shutdown timer, which enables you to shutdown, turn off monitor, reboot or play sound after a period of time.|https://cges30901.github.io/hmtimer-website/|{{AUR|hmtimer}}}}<br />
* {{App|KShutdown|Graphical shutdown utility, which allows you to turn off or suspend a computer at a specified time. It features various time and delay options, command-line support, and notifications.|https://kshutdown.sourceforge.io/|{{Pkg|kshutdown}}}}<br />
<br />
==== Clock synchronization ====<br />
<br />
See [[Time synchronization]].<br />
<br />
==== Screen management ====<br />
<br />
See [[Xrandr#Graphical front-ends]].<br />
<br />
==== Backlight management ====<br />
<br />
See [[Backlight#Backlight utilities]].<br />
<br />
==== Color management ====<br />
<br />
See [[ICC profiles#Utilities]] and [[Backlight#Color correction]].<br />
<br />
==== Printer management ====<br />
<br />
See [[CUPS#GUI applications]].<br />
<br />
==== Bluetooth management ====<br />
<br />
See [[Bluetooth#Front-ends]].<br />
<br />
==== Power management ====<br />
<br />
See [[Power management#Userspace tools]].<br />
<br />
==== System management ====<br />
<br />
See [[Systemd#GUI configuration tools]].<br />
<br />
==== Boot management ====<br />
<br />
See [[GRUB/Tips and tricks#GUI configuration tools]].<br />
<br />
==== Package management ====<br />
<br />
See [[pacman tips#Utilities]].<br />
<br />
==== Configuration management ====<br />
<br />
* {{App|aconfmgr|Package to track, manage, and restore the configuration of an Arch Linux system.|https://github.com/CyberShadow/aconfmgr|{{AUR|aconfmgr-git}}}}<br />
* {{App|[[Ansible]]|IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.|https://www.ansible.com/|{{Pkg|ansible}}}}<br />
* {{App|cdist|Simple configuration management system with Arch Linux support.|https://www.cdi.st/|{{AUR|cdist}}}}<br />
* {{App|[[Chef]]|Automation Software for Continuous Delivery of Secure Applications and Infrastructure.|https://www.chef.io/|{{AUR|chef-workstation}}, {{AUR|chef-client}}}}<br />
* {{App|[[etckeeper]]|Collection of tools to let {{ic|/etc}} be stored in a VCS repository.|https://etckeeper.branchable.com/|{{Pkg|etckeeper}}}}<br />
* {{App|[[Puppet]]|IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance.|https://puppet.com/|{{Pkg|puppet}}}}<br />
<br />
==== Virtualization ====<br />
<br />
See [[Libvirt#Client]] and [[VirtualBox]].<br />
<br />
==== Compatibility layers ====<br />
<br />
See [[Wine]] (Windows) and [https://www.darlinghq.org/ Darling] (MacOS).</div>Cjc7373https://wiki.archlinux.org/index.php?title=IPv6&diff=775258IPv62023-04-10T14:56:23Z<p>Cjc7373: /* Prefix delegation (DHCPv6-PD) */ Add link to systemd.network EXAMPLES</p>
<hr />
<div>[[Category:Networking]]<br />
[[ja:IPv6]]<br />
[[pt:IPv6]]<br />
[[ru:IPv6]]<br />
[[zh-hans:IPv6]]<br />
{{Related articles start}}<br />
{{Related|IPv6 tunnel broker setup}}<br />
{{Related articles end}}<br />
<br />
In Arch Linux, [[Wikipedia:IPv6|IPv6]] is enabled by default.<br />
<br />
The [https://tldp.org/HOWTO/Linux+IPv6-HOWTO/index.html tldp Linux+IPv6-HOWTO] article is older, and less maintained. Yet it attempts to cover many topics that are mentioned in this article, starts from the basics, and advances in a slower pace. It also has many command line examples. Beginners might want to read or skim it before reading this wiki article.<br />
<br />
== Neighbor discovery ==<br />
<br />
Pinging the multicast address {{ic|ff02::1}} results in all hosts in link-local scope responding. An interface has to be specified:<br />
<br />
$ ping ff02::1%eth0<br />
<br />
After that, you can get a list of all the neighbors in the local network with:<br />
<br />
$ ip -6 neigh<br />
<br />
With a ping to the multicast address {{ic|ff02::2}} only routers will respond.<br />
<br />
If you add an option {{ic|-I ''your-global-ipv6''}}, link-local hosts will respond with their link-global scope addresses. The interface can be omitted in this case:<br />
<br />
$ ping -I 2001:4f8:fff6::21 ff02::1<br />
<br />
To ping everyone on all interfaces, and announce your address to everyone, use a script.<br />
<br />
#!/usr/bin/bash<br />
declare -a l_ifs<br />
readarray l_ifs < <(/sbin/ip -6 -j address | jq -r '.[] | .ifname ')<br />
for l_if in ${l_ifs[@]} ; do<br />
echo $l_if<br />
declare -a l_addrs<br />
readarray l_addrs < <(/sbin/ip -6 -j address show dev "$l_if" | \<br />
jq -r '.[0].addr_info[].local')<br />
for l_addr in ${l_addrs[@]} ; do<br />
echo $l_addr<br />
ping -c 4 -6 -I "$l_addr" ff02::1%"$l_if"<br />
done<br />
done<br />
<br />
== Stateless autoconfiguration (SLAAC) ==<br />
<br />
The easiest way to acquire an IPv6 address as long as your network is configured is through ''Stateless address autoconfiguration'' (SLAAC for short). The address is automatically inferred from the prefix that your router advertises and requires neither further configuration nor specialized software such as a DHCP client.<br />
<br />
=== For clients ===<br />
<br />
If you are using [[netctl]] you just need to add the following line to your Ethernet or wireless configuration.<br />
<br />
IP6=stateless<br />
<br />
If you are using [[NetworkManager]] then it automatically enables IPv6 addresses if there are advertisements for them in the network.<br />
<br />
Please note that stateless autoconfiguration works on the condition that IPv6 icmp packets are allowed throughout the network. So for the client side the {{ic|ipv6-icmp}} packets must be accepted. If you are using the [[Simple stateful firewall]]/[[iptables]] you only need to add:<br />
<br />
-A INPUT -p ipv6-icmp -j ACCEPT<br />
<br />
If you are using an other firewall frontend (ufw, shorewall, etc) consult their documentation on how to enable the {{ic|ipv6-icmp}} packets.<br />
<br />
If your chosen network management solution does not support configuring the DNS resolver with stateless IPv6 (e.g. ''netctl''), then it is possible to use {{man|8|rdnssd}} from the {{pkg|ndisc6}} package for that.<br />
<br />
=== For gateways ===<br />
<br />
To properly hand out IPv6s to the network clients we will need to use an advertising daemon. The standard tool for this job is {{Pkg|radvd}}. Configuration of ''radvd'' is fairly simple. Edit {{ic|/etc/radvd.conf}} to include<br />
<br />
# replace LAN with your LAN facing interface<br />
interface LAN {<br />
AdvSendAdvert on;<br />
MinRtrAdvInterval 3;<br />
MaxRtrAdvInterval 10;<br />
prefix ::/64 {<br />
AdvOnLink on;<br />
AdvAutonomous on;<br />
AdvRouterAddr on;<br />
};<br />
};<br />
<br />
The above configuration will tell clients to autoconfigure themselves using addresses from the advertised /64 block. Please note that the above configuration advertises ''all available prefixes'' assigned to the LAN facing interface. If you want to limit the advertised prefixes instead of {{ic|::/64}} use the desired prefix, e.g. {{ic|2001:DB8::/64}}. The {{ic|prefix}} block can be repeated many times for more prefixes.<br />
<br />
To advertise DNS servers to your LAN clients you can use RDNSS feature. For example, add the following lines to {{ic|/etc/radvd.conf}} to advertise Google's DNS v6 servers:<br />
<br />
RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 {<br />
};<br />
<br />
The gateway must also allow the traffic of {{ic|ipv6-icmp}} packets on all basic chains. For the [[Simple stateful firewall]]/[[iptables]] add:<br />
<br />
-A INPUT -p ipv6-icmp -j ACCEPT<br />
-A OUTPUT -p ipv6-icmp -j ACCEPT<br />
-A FORWARD -p ipv6-icmp -j ACCEPT<br />
<br />
Adjust accordingly for other firewall frontends and do not forget to [[enable]] {{ic|radvd.service}}.<br />
<br />
== Privacy extensions ==<br />
<br />
When a client acquires an address through SLAAC its IPv6 address is derived from the advertised prefix and the MAC address of the network interface of the client. This may raise privacy concerns as the MAC address of the computer can be easily derived by the IPv6 address. In order to tackle this problem the ''IPv6 Privacy Extensions'' standard ([[RFC:4941|RFC 4941]]) has been developed. With privacy extensions the kernel generates a ''temporary'' address that is mangled from the original autoconfigured address. Private addresses are preferred when connecting to a remote server so the original address is hidden. To enable Privacy Extensions reproduce the following steps:<br />
<br />
Add these lines to {{ic|/etc/sysctl.d/40-ipv6.conf}}:<br />
<br />
# Enable IPv6 Privacy Extensions<br />
net.ipv6.conf.all.use_tempaddr = 2<br />
net.ipv6.conf.default.use_tempaddr = 2<br />
net.ipv6.conf.''nic0''.use_tempaddr = 2<br />
...<br />
net.ipv6.conf.''nicN''.use_tempaddr = 2<br />
<br />
Where {{ic|nic0}} to {{ic|nicN}} are your '''N'''etwork '''I'''nterface '''C'''ards. You can find their names using the instructions in [[Network configuration#Listing network interfaces]]. The {{ic|all.use_tempaddr}} or {{ic|default.use_tempaddr}} parameters are not applied to nic's that already exist when the [[sysctl]] settings are executed.<br />
<br />
After a reboot, at the latest, Privacy Extensions should be enabled.<br />
<br />
=== dhcpcd ===<br />
<br />
[[dhcpcd]]'s default configuration includes the option {{ic|slaac private}}, which enables "Stable Private IPv6 Addresses instead of hardware based ones", implementing [[RFC:7217|RFC 7217]]. Therefore, it is not necessary to change anything, except if it is desired to change of IPv6 address more often than each time the system is connected to a new network. Set it to {{ic|slaac hwaddr}} for a stable address.<br />
<br />
=== NetworkManager ===<br />
<br />
The use of IPv6 Privacy Extensions in [[NetworkManager]] can be controlled with the {{ic|ipv6.ip6-privacy}} setting in {{man|5|NetworkManager.conf}} or in the connection's profile. If it is not set globally nor per-connection, NetworkManager will fall back to reading {{ic|/proc/sys/net/ipv6/conf/default/use_tempaddr}}.<br />
<br />
To explicitly enable IPv6 Privacy Extensions by default, add these lines to {{man|5|NetworkManager.conf}}:<br />
<br />
{{hc|/etc/NetworkManager/conf.d/ip6-privacy.conf|2=<br />
[connection]<br />
ipv6.ip6-privacy=2<br />
}}<br />
<br />
[[NetworkManager#Configuration|Apply the configuration]] and reconnect to all active connections.<br />
<br />
To control the use of IPv6 Privacy Extensions for individual NetworkManager-managed connections, edit the desired connection keyfile in {{ic|/etc/NetworkManager/system-connections/}} and append to its {{ic|[ipv6]}} section the key-value pair {{ic|1=ip6-privacy=2}}:<br />
<br />
{{hc|/etc/NetworkManager/system-connections/''example_connection''.nmconnection|2=<br />
...<br />
[ipv6]<br />
method=auto<br />
'''ip6-privacy=2'''<br />
...<br />
}}<br />
<br />
Reload the connection and reconnect to it afterwards.<br />
<br />
{{Note|Although it may seem the {{ic|scope global temporary}} IPv6 address created by enabling Privacy Extensions never gets renewed (it never shifts to {{ic|deprecated}} status at the term of its {{ic|valid_lft}} lifetime), it is to be verified over a longer period of time that this address '''does''' indeed change.}}<br />
<br />
=== systemd-networkd ===<br />
<br />
''systemd-networkd'' also does not honor the settings {{ic|net.ipv6.conf.''nicN''.use_tempaddr}} placed in {{ic|/etc/sysctl.d/40-ipv6.conf}} unless the option {{ic|IPv6PrivacyExtensions}} is set with the value {{ic|kernel}} in the ''.network'' file(s).<br />
<br />
Other options for the IPv6 Privacy Extensions like:<br />
<br />
{| class="wikitable"<br />
! Variable name<br />
! Description<br />
|-<br />
| {{ic|net.ipv6.conf.''nicN''.temp_prefered_lft}}<br />
| Preferred temp address lifetime in seconds. Note the wrong spelling has to be used.<br />
|-<br />
| {{ic|net.ipv6.conf.''nicN''.temp_valid_lft}}<br />
| Maximum temp address lifetime in seconds.<br />
|-<br />
|}<br />
<br />
are honored, however.[https://docs.kernel.org/networking/ip-sysctl.html?highlight=use_tempaddr]<br />
<br />
See [[systemd-networkd]] and {{man|5|systemd.network}} for details.<br />
<br />
=== ConnMan ===<br />
<br />
Set in a service file, i.e. {{ic|/var/lib/connman/''service''/settings}}:<br />
<br />
IPv6.privacy=preferred<br />
<br />
See [[ConnMan]] for details.<br />
<br />
== Stable private addresses ==<br />
<br />
Another option is a stable private IP address ([[RFC:7217|RFC 7217]]). This allows for IPs that are stable within a network without exposing the MAC address of the interface.<br />
<br />
In order to have the kernel generate a key (for {{ic|wlan0}}, for example) we can set:<br />
<br />
# sysctl net.ipv6.conf.wlan0.addr_gen_mode=3<br />
<br />
Bring the interface down and up and you should see {{ic|stable-privacy}} next to each IPv6 address after running {{ic|ip addr show dev wlan0}}. The kernel has generated a 128-bit secret for generating ip addresses for this interface, to see it run {{ic|sysctl net.ipv6.conf.wlan0.stable_secret}}. We are going to persist this value so add the following lines to {{ic|/etc/sysctl.d/40-ipv6.conf}}:<br />
<br />
# Enable IPv6 stable privacy mode<br />
net.ipv6.conf.wlan0.stable_secret = ''output_from_previous_command''<br />
net.ipv6.conf.wlan0.addr_gen_mode = 2<br />
<br />
{{Note|If you are using [[dhcpcd]] to get the IPv6 address, the {{ic|stable-privacy}} flag will '''not''' be attributed to this IP address.}}<br />
<br />
=== NetworkManager ===<br />
<br />
The above settings are not honored by NetworkManager, but NetworkManager uses stable private addresses by default.[https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/nm-1-12/NEWS#L367-369][https://bugzilla.redhat.com/show_bug.cgi?id=1279242#c15]<br />
<br />
== Static address ==<br />
<br />
Sometimes, using a static address can improve security. For example, if your local router uses Neighbor Discovery or ''radvd'' ([[RFC:2461|RFC 2461]]), your interface will automatically be assigned an address based on its MAC address (using IPv6's Stateless Autoconfiguration). This may be less than ideal for security since it allows a system to be tracked even if the network portion of the IP address changes.<br />
<br />
To assign a static IP address using [[netctl]], look at the example profile in {{ic|/etc/netctl/examples/ethernet-static}}. The following lines are important:<br />
<br />
...<br />
# For IPv6 static address configuration<br />
IP6=static<br />
Address6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')<br />
Routes6=('abcd::1234')<br />
Gateway6='1234:0:123::abcd'<br />
<br />
{{Note|1=If you are connected IPv6-only, then you need to determine your IPv6 DNS server. For example:<br />
<br />
DNS=('6666:6666::1' '6666:6666::2')<br />
<br />
If your provider did not give you IPv6 DNS and you are not running your own, you can choose from the [[resolv.conf]] article.<br />
}}<br />
<br />
== IPv6 and PPPoE ==<br />
<br />
The standard tool for PPPoE, {{man|8|pppd}}, provides support for IPv6 on PPPoE as long as your ISP and your modem support it. Just add the following to {{ic|/etc/ppp/options}}<br />
<br />
+ipv6<br />
<br />
If you are using [[netctl]] for PPPoE then just add the following to your ''netctl'' configuration instead:<br />
<br />
PPPoEIP6=yes<br />
<br />
== Prefix delegation (DHCPv6-PD) ==<br />
<br />
{{Note|This section is targeted towards custom gateway configuration, not client machines. For standard market routers please consult the documentation of your router on how to enable prefix delegation.}}<br />
<br />
Prefix delegation is a common IPv6 deployment technique used by many ISPs. It is a method of assigning a network prefix to a user site (i.e. local network). A router can be configured to assign different network prefixes to various subnetworks. The ISP hands out a network prefix using DHCPv6 (usually a {{ic|/56}} or {{ic|/64}}) and a dhcp client assigns the prefixes to the local network. For a simple two interface gateway it practically assigns an IPv6 prefix to the interface connected to to the local network from an address acquired through the interface connected to WAN (or a pseudo-interface such as [[ppp]]).<br />
<br />
DHCPv6 requires the client to receive incoming connections on port 546 UDP. For an [[nftables]]-based firewall, that can be configured with one line in the input chain in {{ic|/etc/nftables.conf}}:<br />
<br />
table inet filter {<br />
chain input {<br />
udp dport dhcpv6-client accept<br />
...<br />
}<br />
...<br />
}<br />
<br />
=== With dhcpcd ===<br />
<br />
[[dhcpcd]] apart from IPv4 dhcp support also provides a fairly complete implementation of the DHCPv6 client standard which includes DHCPv6-PD. If you are using {{ic|dhcpcd}} edit {{ic|/etc/dhcpcd.conf}}. You might already be using dhcpcd for IPv4 so just update your existing configuration.<br />
<br />
{{bc|<br />
duid<br />
noipv6rs<br />
waitip 6<br />
# Uncomment this line if you are running dhcpcd for IPv6 only.<br />
#ipv6only<br />
<br />
# use the interface connected to WAN<br />
interface WAN<br />
ipv6rs<br />
iaid 1<br />
# use the interface connected to your LAN<br />
ia_pd 1 LAN<br />
#ia_pd 1/::/64 LAN/0/64<br />
}}<br />
<br />
This configuration will ask for a prefix from WAN interface ({{ic|WAN}}) and delegate it to the internal interface ({{ic|LAN}}).<br />
In the event that a {{ic|/64}} range is issued, you will need to use the 2nd {{ic|ia_pd instruction}} that is commented out instead.<br />
It will also disable router solicitations on all interfaces except for the WAN interface ({{ic|WAN}}).<br />
<br />
{{Tip|Also read {{man|8|dhcpcd}} and {{man|5|dhcpcd.conf}}.}}<br />
<br />
=== With WIDE-DHCPv6 ===<br />
<br />
[http://wide-dhcpv6.sourceforge.net/ WIDE-DHCPv6] is an open-source implementation of Dynamic Host Configuration Protocol for IPv6 (DHCPv6) originally developed by the KAME project. It can be [[install]]ed with {{AUR|wide-dhcpv6}}.<br />
<br />
If you are using ''wide-dhcpv6'', edit {{ic|/etc/wide-dhcpv6/dhcp6c.conf}}<br />
<br />
{{bc|<br />
# use the interface connected to your WAN<br />
interface WAN {<br />
send ia-pd 0;<br />
};<br />
<br />
id-assoc pd 0 {<br />
# use the interface connected to your LAN<br />
prefix-interface LAN {<br />
sla-id 1;<br />
sla-len 8;<br />
};<br />
};<br />
}}<br />
<br />
{{Note|1={{ic|sla-len}} should be set so that {{ic|1=(WAN-prefix) + (sla-len) = 64}}. In this case it is set up for a {{ic|/56}} prefix 56+8=64. For a {{ic|/64}} prefix {{ic|sla-len}} should be {{ic|0}}.}}<br />
<br />
The ''wide-dhcpv6'' client can be [[started/enabled]] using the {{ic|dhcp6c@''interface''.service}} systemd unit file, where {{ic|''interface''}} is the interface name in the configuration file, e.g. for a interface name "WAN" use {{ic|dhcp6c@WAN.service}}.<br />
<br />
{{Tip|Read {{man|8|dhcp6c|url=}} and {{man|5|dhcp6c.conf|url=}} for more information.}}<br />
<br />
=== systemd-networkd ===<br />
<br />
Configure both your upstream (wan) and downstream (lan) interface. This will enable DHCPv6-PD on the interface where the DHCPv6 client is running. The delegated prefixes are distributed by IPv6 Router Advertisement on the downstream network.<br />
<br />
{{hc|/etc/systemd/network/wan.network|2=<br />
[Network]<br />
# Use 'yes' instead of 'ipv6' for both ipv4 and ipv6.<br />
DHCP=ipv6<br />
}}<br />
<br />
{{hc|/etc/systemd/network/lan.network|2=<br />
[Network]<br />
IPv6SendRA=yes<br />
DHCPv6PrefixDelegation=yes<br />
}}<br />
<br />
{{Tip|Also read {{man|5|systemd.network|EXAMPLES}}.}}<br />
<br />
=== Other clients ===<br />
<br />
[[dhclient]] can also request a prefix, but assigning that prefix, or parts of that prefix to interfaces must be done using a ''dhclient'' exit script. For example: https://github.com/jaymzh/v6-gw-scripts/blob/master/dhclient-ipv6.<br />
<br />
== NAT64 ==<br />
<br />
[[Wikipedia:NAT64]] is the IPv6 transition mechanism where IPv6 only hosts are able to communicate with IPv4 hosts using NAT.<br />
<br />
Linux kernel does not support NAT64 natively but there are several packages to add support for NAT64.<br />
<br />
* {{App|Jool|SIIT and NAT64 for Linux|https://nicmx.github.io/Jool/|{{AUR|jool-dkms}}, {{AUR|jool-tools}}}}<br />
* {{App|TAYGA|NAT64 daemon (unmaintained)|http://www.litech.org/tayga/|{{AUR|tayga}}}}<br />
<br />
== Disable IPv4 ==<br />
<br />
{{Expansion|Add instructions to disable legacy IP, esp. if the network has NAT64 and DNS64 we do not need to maintain dualstack, also the implementation of CGN degraded ipv4 performance and usability (e.g. hosting nextcloud at home is nowadays often only possible using only ipv6 and services like dynv6.com or namecheap dyndns records. This is because no public ipv4 is available, not even to the CPE router)}}<br />
<br />
== Disable IPv6 ==<br />
<br />
{{Note|The Arch kernel has IPv6 support built in directly, therefore a module cannot be blacklisted.}}<br />
<br />
{{Expansion|Add reasons why users may want to disable IPv6, such as low-quality DNS servers or firewall rules}}<br />
{{Expansion|Add drawbacks of disabling IPv6, like degraded performance behind CGN, worse performance in p2p/webrtc based applications and games}}<br />
<br />
=== Disable functionality ===<br />
<br />
Adding {{ic|1=ipv6.disable=1}} to the kernel line disables the whole [https://docs.kernel.org/networking/ipv6.html IPv6 stack], which is likely what you want if you are experiencing issues. See [[Kernel parameters]] for more information.<br />
<br />
Alternatively, adding {{ic|1=ipv6.disable_ipv6=1}} instead will keep the IPv6 stack functional but will not assign IPv6 addresses to any of your network devices.<br />
<br />
One can also avoid assigning IPv6 addresses to all or specific network interfaces by adding the following [[sysctl]] configuration to {{ic|/etc/sysctl.d/40-ipv6.conf}}:<br />
<br />
# Disable IPv6<br />
net.ipv6.conf.all.disable_ipv6 = 1<br />
net.ipv6.conf.''nic0''.disable_ipv6 = 1<br />
...<br />
net.ipv6.conf.''nicN''.disable_ipv6 = 1<br />
<br />
[[Restart]] the {{ic|systemd-sysctl.service}} unit to apply the configuration changes.<br />
<br />
{{Tip|If the IPv6 stack is not disabled, it is also possible to disable IPv6 for interfaces at runtime to test configuration changes. Executing {{ic|1=# sysctl -w net.ipv6.conf.all.disable_ipv6=1}} drops assigned IPv6 addresses plus its routes, and can be reversed.}}<br />
<br />
{{Note|If disabling IPv6 via ''sysctl'', you should comment out the IPv6 hosts in your {{ic|/etc/hosts}}. Otherwise there could be some connection errors because hosts are resolved to their IPv6 address which is not reachable.}}<br />
<br />
=== Other programs ===<br />
<br />
Disabling IPv6 functionality in the kernel does not prevent other programs from trying to use IPv6. In most cases, this is completely harmless, but if you find yourself having issues with that program, you should consult the program's manual pages for a way to disable that functionality.<br />
<br />
==== dhcpcd ====<br />
<br />
''dhcpcd'' will continue to harmlessly attempt to perform IPv6 router solicitation. To disable this, as stated in the {{man|5|dhcpcd.conf}} [[man page]], add the following to {{ic|/etc/dhcpcd.conf}}:<br />
<br />
noipv6rs<br />
noipv6<br />
<br />
==== NetworkManager ====<br />
<br />
To disable IPv6 in NetworkManager, right click the network status icon, and select ''Edit Connections > Wired > ''Network name'' > Edit > IPv6 Settings > Method > Ignore/Disabled''. Then click ''Save''.<br />
<br />
This can also be done as: <br />
<br />
# nmcli connection modify ''ConnectionName'' ipv6.method "disabled"<br />
<br />
Followed by a restart of the network connection:<br />
<br />
# nmcli connection up ''ConnectionName''<br />
<br />
To confirm the settings have been applied, use {{ic|ip address show}} and check no inet6 entry is displayed. Alternatively, {{ic|/proc/sys/net/ipv6/conf/''interface''/disable_ipv6}} should have the value 1.<br />
<br />
==== ntpd ====<br />
<br />
Following advice in [[systemd#Drop-in files]], [[edit]] {{ic|ntpd.service}} to define how ''systemd'' starts it.<br />
<br />
This will create a drop-in snippet that will be run instead of the default {{ic|ntpd.service}}. The {{ic|-4}} flag prevents IPv6 from being used by the ''ntp'' daemon. Put the following into the drop-in snippet:<br />
<br />
[Service]<br />
ExecStart=<br />
ExecStart=/usr/bin/ntpd -4 -g -u ntp:ntp<br />
<br />
which first clears the previous {{ic|ExecStart}}, and then replaces it with one that includes the {{ic|-4}} flag.<br />
<br />
==== GnuPG ====<br />
<br />
Disable IPv6 in the ''dirmngr''<nowiki/>'s configuration file:<br />
<br />
{{hc|~/.gnupg/dirmngr.conf|<br />
disable-ipv6<br />
}}<br />
<br />
[[Restart]] the {{ic|dirmngr.service}} user unit afterwards.<br />
<br />
==== sshd ====<br />
<br />
Ensure ''sshd'' is using IPv4 by adding the following to {{ic|sshd_config}}:<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
AddressFamily inet<br />
}}<br />
<br />
And restart the {{ic|sshd.service}}.<br />
<br />
==== systemd-timesyncd ====<br />
<br />
On occasion [[systemd-timesyncd]] will attempt to query an IPv6 timeserver even when IPv6 has been disabled. This can result in the system clock not being updated and the journal showing an error similar to:<br />
<br />
systemd-timesyncd[336]: Failed to set up connection socket: Address family not supported by protocol<br />
<br />
The [[unit status]] of {{ic|systemd-timesyncd}} will show an attempt to connect with an IPv6 address in its ''Status'' entry, similar to:<br />
<br />
Status: "Connecting to time server [2001:19f0:8001:afd:5400:1ff:fe9d:cba]:123 (2.pool.ntp.org)"<br />
<br />
Per {{Bug|59806}}, only the "2." ntp.org pools serve IPv6. So to prevent this remove {{ic|2.arch.pool.ntp.org}} and {{ic|2.pool.ntp.org}} from the NTP and FallbackNTP entries in {{ic|/etc/systemd/timesyncd.conf}} file.<br />
<br />
=== systemd-networkd ===<br />
<br />
''networkd'' supports disabling IPv6 on a per-interface basis. When a network unit's {{ic|[Network]}} section has either {{ic|1=LinkLocalAddressing=ipv4}} or {{ic|1=LinkLocalAddressing=no}}, networkd will not try to configure IPv6 on the matching interfaces.<br />
<br />
Note however that even when using the above option, ''networkd'' will still be expecting to receive router advertisements if IPv6 is not disabled globally. If IPv6 traffic is not being received by the interface (e.g. due to ''sysctl'' or ''ip6tables'' settings), it will remain in the configuring state and potentially cause timeouts for services waiting for the network to be fully configured. To avoid this, the {{ic|1=IPv6AcceptRA=no}} option should also be set in the {{ic|[Network]}} section.<br />
<br />
== Prefer IPv4 over IPv6 ==<br />
<br />
{{Accuracy|This disables the other default rules. [https://serverfault.com/a/93782/]|section=Factual accuracy - Prefer IPv4 over IPv6}}<br />
<br />
Uncomment the following line in {{ic|/etc/gai.conf}}:<br />
<br />
#<br />
# For sites which prefer IPv4 connections change the last line to<br />
#<br />
precedence ::ffff:0:0/96 100<br />
<br />
== See also ==<br />
<br />
* [https://docs.kernel.org/networking/ipv6.html IPv6] — kernel.org documentation<br />
* [https://www.ipsidixit.net/2012/08/09/ipv6-temporary-addresses-and-privacy-extensions/ IPv6 temporary addresses] — a summary about temporary addresses and privacy extensions<br />
* [https://mirrors.deepspace6.net/howtos/Linux+IPv6-HOWTO.html#AEN520 IPv6 prefixes] — a summary of prefix types<br />
* [https://tldp.org/HOWTO/Linux+IPv6-HOWTO/ch11s02.html net.ipv6 options] — documentation of kernel parameters</div>Cjc7373https://wiki.archlinux.org/index.php?title=Pacman_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=641166Pacman (简体中文)2020-11-10T05:38:39Z<p>Cjc7373: /* Pacman 不使用我的代理设置 */ update formats</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package management (简体中文)]]<br />
[[Category:Arch projects (简体中文)]]<br />
[[Category:Commands (简体中文)]]<br />
[[ar:Pacman]]<br />
[[cs:Pacman]]<br />
[[da:Pacman]]<br />
[[de:Pacman]]<br />
[[el:Pacman]]<br />
[[en:Pacman]]<br />
[[es:Pacman]]<br />
[[fa:Pacman]]<br />
[[fr:Pacman]]<br />
[[id:Pacman]]<br />
[[it:Pacman]]<br />
[[ja:Pacman]]<br />
[[ko:Pacman]]<br />
[[nl:Pacman]]<br />
[[pl:Pacman]]<br />
[[pt:Pacman]]<br />
[[ru:Pacman]]<br />
[[sr:Pacman]]<br />
[[sv:Pacman]]<br />
[[zh-hant:Pacman]]<br />
{{Related articles start (简体中文)}}<br />
{{Related|Creating packages (简体中文)}}<br />
{{Related|软件包降级}}<br />
{{Related|pacman/Package signing (简体中文)}}<br />
{{Related|pacman/Pacnew and Pacsave (简体中文)}}<br />
{{Related|pacman/Rosetta (简体中文)}}<br />
{{Related|pacman/Tips and tricks (简体中文)}}<br />
{{Related|FAQ (简体中文)}}<br />
{{Related|System maintenance (简体中文)}}<br />
{{Related|Arch Build System (简体中文)}}<br />
{{Related|Official repositories (简体中文)}}<br />
{{Related|Arch User Repository (简体中文)}}<br />
{{Related articles end}}<br />
{{TranslationStatus (简体中文)|pacman|2020-10-20|639260}}<br />
[https://archlinux.org/pacman/ pacman][[Wikipedia:Package management system|软件包管理器]]是 Arch Linux 的一大亮点。它将一个简单的二进制包格式和易用的[[Arch Build System (简体中文)|构建系统]]结合了起来。''pacman''的目标是简化对软件包的管理,无论软件包是来自[[Official repositories (简体中文)|官方软件仓库]]还是来自用户自己的创建。<br />
<br />
''pacman'' 通过和主服务器同步软件包列表来进行系统更新。这种服务器/客户端模式可在使用一条命令就下载或安装软件包的同时,也安装其必需的依赖包。<br />
<br />
''pacman'' 用 [[C (简体中文)|C 语言]]编写,使用{{man|1|bsdtar}}[[w:tar (computing)|tar]]作为打包格式。<br />
<br />
{{小贴士|1={{Pkg|pacman}} 软件包除提供了[[makepkg (简体中文)|makepkg]]和{{man|8|vercmp}}等工具外,其它的有用工具如 '''pactree'''、[[System maintenance (简体中文)#不支持部分升级|checkupdates]]等可在{{Pkg|pacman-contrib}}([https://git.archlinux.org/pacman.git/commit/?id=0c99eabd50752310f42ec808c8734a338122ec86 曾]是 ''pacman'' 的内置工具)中找到。你可以通过 {{ic|pacman -Ql pacman {{!}} grep -E 'bin/.+'}} 获取全部的工具列表。}}<br />
<br />
==用法==<br />
<br />
下面''pacman''可以执行的操作的一小部分,''pacman'' 的其他示例请阅读{{man|8|pacman}}。<br />
<br />
{{小贴士|使用过其它发行版的用户,可以参考 [[Pacman Rosetta]] 中的对比.}}<br />
<br />
===安装软件包===<br />
<br />
一个软件包是一个归档,它包含:<br />
* 一个应用的所有(编译好的)文件<br />
* 有关该应用的元数据,例如应用名称,版本,依赖……<br />
* 供 pacman 使用的安装文件和指令<br />
* (可选)使软件更易操作的额外文件,例如启动/终止脚本<br />
<br />
Arch 的软件包管理器 pacman 可以安装,更新,和删除这些软件包。使用软件包而不是自己编译安装有如下优势:<br />
* 轻松升级:pacman 会在更新可用时立即更新已安装的软件包<br />
* 依赖检查:pacman 负责为你处理依赖问题,你只需要指明程序,pacman 就会把它和它所需的所有其他程序都一起安装。<br />
* 干净卸载:pacman 有着一个软件包所有文件的列表。这样,当你决定移除软件包时,不会无意留下文件。<br />
<br />
{{注意|软件包通常有很多[[PKGBUILD#optdepends|可选依赖]], 它们为软件提供额外功能, 并不强制要求安装它们。 安装软件时, ''pacman'' 将会输出它的可选依赖, 但是这个输出不会在 {{ic|pacman.log}}中;当你想浏览已安装软件的可选依赖时可以使用{{ic|pacman -Si}} ,得到关于可选依赖的简短描述。}}<br />
<br />
{{警告|1=在Arch下安装软件包时,未[[#升级软件包|更新]]系统前,'''不要'''更新软件包数据库(例如,可能出现某软件包不再出现在官方库)。操作时,应使用{{ic|pacman -Syu ''package_name''}}, 而不要使用({{ic|pacman -Sy ''package_name''}}),否则可能会有依赖问题。参见 [[System maintenance (简体中文)#不支持部分升级]] 和 [https://bbs.archlinux.org/viewtopic.php?id=89328 BBS#89328].}}<br />
<br />
====安装指定的包====<br />
安装或者升级单个软件包,或者一列软件包(包含依赖包),使用如下命令:<br />
<br />
# pacman -S ''package_name1'' ''package_name2'' ''...''<br />
<br />
用正则表达式安装多个软件包(参见 [https://bbs.archlinux.org/viewtopic.php?id=7179 这个帖子]):<br />
<br />
# pacman -S $(pacman -Ssq ''package_regex'')<br />
<br />
有时候在不同的软件仓库中,一个软件包有多个版本(比如[extra]和[testing])。可以选择一个来安装:<br />
<br />
# pacman -S extra/''package_name''<br />
<br />
安装多个含有相似名称的软件包,而并非整个包组或全部匹配的软件包; 例如,{{Grp|plasma}}:<br />
<br />
# pacman -S plasma-{desktop,mediacenter,nm}<br />
<br />
当然,可以多层扩展,并不作限制:<br />
<br />
# pacman -S plasma-{workspace{,-wallpapers},pa}<br />
<br />
===== 虚包 =====<br />
<br />
虚拟软件包是一个特殊的软件包,它本身并不存在,但由一或多个其它软件包提供。虚拟软件包允许其它软件包不以某一个特定的包为依赖,以应对有多个候选的情况。虚包不能用它们的名称安装,相反它们会在你安装''提供''虚包的软件包时被安装到你的系统中。<br />
<br />
====安装包组====<br />
<br />
一些包属于一个可以同时安装的[[Meta_package_and_package_group_(简体中文)|软件包组]]。例如,运行下面的命令<br />
<br />
# pacman -S gnome<br />
<br />
会提醒用户选择 {{ic|gnome}} 内需要安装的包。<br />
<br />
有的包组包含大量的软件包,有时用户只需其中几个。除了逐一键入序号外,pacman 还支持选择或排除某个区间内的的软件包:<br />
<br />
Enter a selection (default=all): 1-10 15<br />
<br />
这将选中序号 1 至 10 和 15 的软件包。而<br />
<br />
Enter a selection (default=all): ^5-8 ^2<br />
<br />
将会选中除了序号 5 至 8 和 2 之外的所有软件包。<br />
<br />
想要查看哪些包属于 gnome 组,运行:<br />
<br />
# pacman -Sg gnome<br />
<br />
也可以访问 https://www.archlinux.org/groups/ 查看可用的包组。<br />
<br />
{{注意|如果列表中的包已经安装在系统中,它会被重新安装,即使它已经是最新的。可以用 {{ic|--needed}} 选项覆盖这种行为。}}<br />
<br />
===删除软件包===<br />
<br />
删除单个软件包,保留其全部已经安装的依赖关系<br />
<br />
# pacman -R ''package_name''<br />
<br />
删除指定软件包,及其所有没有被其他已安装软件包使用的依赖关系:<br />
<br />
# pacman -Rs ''package_name''<br />
<br />
上面这条命令在移除包含其他所需包的组时有时候会拒绝运行。这种情况下可以尝试<br />
<br />
# pacman -Rsu ''package_name''<br />
<br />
要删除软件包和所有依赖这个软件包的程序:<br />
<br />
{{警告|此操作是递归的,请小心检查,可能会一次删除大量的软件包。}}<br />
<br />
# pacman -Rsc ''package_name''<br />
<br />
要删除一个被其他软件包依赖的软件包,但是不删除依赖这个软件包的其他软件包:<br />
<br />
{{警告|此操作有破坏系统的能力,应该尽量避免使用。详情请看 [[System maintenance#Avoid certain pacman commands|避免某些 Pacman 命令]]。}}<br />
<br />
# pacman -Rdd ''package_name''<br />
<br />
''pacman'' 删除某些程序时会备份重要配置文件,在其后面加上*.pacsave扩展名。-n 选项可以避免备份这些文件:<br />
<br />
pacman -Rn ''package_name''<br />
<br />
{{注意|''pacman'' 不会删除软件自己创建的文件(例如主目录中的“点文件”不会被删除。)}}<br />
<br />
=== 升级软件包 ===<br />
{{警告|<br />
* 建议用户遵守[[System_maintenance_(简体中文)#更新系统]]的指导,定期更新系统,并不盲目地执行这些命令。<br />
* Arch 只支持系统完整升级,详细参见[[System_maintenance_(简体中文)#不支持部分升级]]和[[#安装软件包]]。}}<br />
<br />
一个 ''pacman'' 命令就可以升级整个系统。花费的时间取决于系统有多老。这个命令会同步非本地(local)软件仓库并升级系统的软件包:<br />
<br />
# pacman -Syu<br />
<br />
===查询包数据库===<br />
<br />
''pacman'' 使用 {{ic|-Q}} 参数查询本地软件包数据库, {{ic|-S}} 查询同步数据库,以及 {{ic|-F}}查询文件数据库。要了解每个参数的子选项,分别参见 {{pacman -Q --help}},{{pacman -S --help}}和{{pacman -F --help}}。<br />
<br />
''pacman'' 可以在包数据库中查询软件包,查询位置包含了软件包的名字和描述:<br />
<br />
$ pacman -Ss ''string1'' ''string2'' ...<br />
<br />
有时,{{Ic|-s}}的内置正则会匹配很多不需要的结果,所以应当指定仅搜索包名,而非描述或其他子段:<br />
<br />
$ pacman -Ss '^vim-'<br />
<br />
要查询已安装的软件包:<br />
<br />
$ pacman -Qs ''string1'' ''string2'' ...<br />
<br />
按文件名查找软件库:<br />
<br />
$ pacman -F ''string1'' ''string2'' ...<br />
<br />
显示软件包的详尽的信息:<br />
<br />
$ pacman -Si ''package_name''<br />
<br />
查询本地安装包的详细信息:<br />
<br />
$ pacman -Qi ''package_name''<br />
<br />
使用两个 {{ic|-i}} 将同时显示备份文件和修改状态:<br />
<br />
$ pacman -Qii ''package_name''<br />
<br />
要获取已安装软件包所包含文件的列表:<br />
<br />
$ pacman -Ql ''package_name''<br />
<br />
查询远程库中软件包包含的文件:<br />
<br />
$ pacman -Fl ''package_name''<br />
<br />
检查软件包安装的文件是否都存在:<br />
<br />
$ pacman -Qk ''package_name''<br />
<br />
两个参数{{ic|k}}将会执行一次更彻底的检查。<br />
查询数据库获取某个文件属于哪个软件包:<br />
<br />
$ pacman -Qo ''/path/to/file_name''<br />
<br />
查询文件属于远程数据库中的哪个软件包:<br />
<br />
$ pacman -F ''/path/to/file_name''<br />
<br />
要罗列所有不再作为依赖的软件包(孤立orphans):<br />
<br />
$ pacman -Qdt<br />
<br />
{{提示|将上述命令添加到 pacman 的一个处理后 [[#Hooks|hook]]用于在如果有处理产生孤立包后获得提示。这在当有软件包被仓库放弃时是有用的,因为任何被抛弃的包都会成为本地的一个孤立包(除非它是被显式安装的)。要避免在没有找到孤立包时"failed to execute command”的错误,在你的 hook 中为{{ic|Exec}}使用如下的指令: {{ic|<nowiki>/usr/bin/bash -c "/usr/bin/pacman -Qtd || /usr/bin/echo '=> None found.'"</nowiki>}}}}<br />
<br />
要罗列所有明确安装而且不被其它包依赖的软件包:<br />
<br />
$ pacman -Qet<br />
<br />
更多例子查看[[pacman tips]]。<br />
<br />
==== Pactree ====<br />
{{注意|{{man|8|pactree}}不再是{{Pkg|pacman}}的一部分。它现在在{{Pkg|pacman-contrib}}中。}}<br />
<br />
要显示软件包的依赖树:<br />
<br />
$ pactree ''package_name''<br />
<br />
检查一个''安装''的软件包被那些包依赖,将递归标识{{ic|-r}}传递给 ''pactree'',或者使用 {{AUR|pkgtools}}中的''whoneeds''<br />
<br />
==== 数据库结构 ====<br />
<br />
pacman数据库通常位于 {{ic|/var/lib/pacman/sync}}. 对于每一个在{{ic|/etc/pacman.conf}}中指定的软件仓库, 这里都有一个一致的数据库。数据库文件夹里每个tar.gz文件都包含着一个仓库的软件包信息。例如{{Pkg|which}} 包:<br />
<br />
{{hc|$ tree which-2.21-5|<br />
which-2.21-5<br />
{{!}}-- desc<br />
}}<br />
<br />
这个 {{ic|depends}} 项列出了该软件的依赖包, 而{{ic|desc}}有该包的介绍,例如文件大小和MD5值 。<br />
<br />
=== 清理软件包缓存 ===<br />
<br />
''pacman'' 将下载的软件包保存在 {{ic|/var/cache/pacman/pkg/}} 并且不会自动移除旧的和未安装版本的软件包。这样做有一些好处:<br />
# 这样允许[[Downgrading packages (简体中文)|降级]]软件包而不需要通过其他方式提取旧版本,例如 [[Arch Linux Archive (简体中文)|Arch Linux Archive]].<br />
# 被卸载的软件包可以轻易地直接从缓存文件夹重新安装,不需要重新从软件仓库下载。<br />
<br />
然而,需要定期手动清理缓存来避免该文件夹无限制增大。<br />
<br />
{{Pkg|pacman-contrib}} 提供的 {{man|8|paccache}} 脚本默认会删除所有缓存的版本和已卸载的软件包,除了最近的3个会被保留:<br />
<br />
# paccache -r<br />
<br />
[[Enable|启用]] 和 [[start|启动]] {{ic|paccache.timer}}来每周删除不使用的包。<br />
<br />
{{提示|1=可以使用 [[#Hooks|hook]] 自动执行清理,参考[https://bbs.archlinux.org/viewtopic.php?pid=1694743#p1694743]和{{AUR|pacman-cleanup-hook}}。}}<br />
<br />
也可以自己设置保留最近几个版本:<br />
<br />
# paccache -rk1<br />
<br />
添加{{ic|-u}}/{{ic|--uninstalled}}开关来限制''paccache''的行为只作用于卸载的包。例如清理所有卸载的包的缓存版本,可以用以下命令:<br />
<br />
# paccache -ruk0<br />
<br />
或者你可以将安装其结合,同时作用于安装的和卸载的包,例如想要保留最近两个安装的包但是移除所有卸载的包的缓存版本,使用以下命令:<br />
# paccache -rk2 -ruk0<br />
<br />
更多参数参见{{ic|paccache -h}}。<br />
<br />
''pacman''也有一些内建参数用于清除缓存和那些不再在{{ic|/etc/pacman.conf}}配置文件中列出的软件仓库残留数据库文件。然而''pacman''并不提供保留一定数量的过去版本的功能,因此它比''paccache''的默认选项更加激进。<br />
<br />
要删除目前没有安装的所有缓存的包,和没有被使用的同步数据库,执行:<br />
<br />
# pacman -Sc<br />
<br />
要删除缓存中的全部文件,使用两次{{ic|-c}}开关。这是最为激进的方式,将会清空缓存文件夹:<br />
<br />
# pacman -Scc<br />
<br />
{{警告|应当避免从缓存中删除所有过去版本和卸载的包,除非需要更多磁盘空间。这样会导致无法降级或重新安装包而不再次下载他们}}<br />
<br />
{{AUR|pkgcacheclean}}以及{{AUR|pacleaner}}是两个进一步清理缓存的替代工具<br />
<br />
===其它命令===<br />
<br />
升级系统时安装其他软件包:<br />
<br />
# pacman -Syu ''package_name1'' ''package_name2'' ...<br />
<br />
下载包而不安装它:<br />
# pacman -Sw package_name<br />
<br />
安装一个'''本地'''包(不从源里下载):<br />
# pacman -U ''/path/to/package/package_name-version.pkg.tar.xz''<br />
<br />
要将本地包保存至缓存,可执行:<br />
# pacman -U file:///''path/to/package/package_name-version.pkg.tar.xz''<br />
<br />
安装一个'''远程'''包(不在 ''pacman'' 配置的源里面):<br />
# pacman -U ''<nowiki>http://www.example.com/repo/example.pkg.tar.xz</nowiki>''<br />
<br />
要禁用 {{ic|-S}}, {{ic|-U}} 和 {{ic|-R}} 动作,可以使用 {{ic|-p}} 选项.<br />
<br />
''pacman'' 会列出需要安装和删除的软件,并在执行动作前要求需要的权限。<br />
<br />
===安装原因===<br />
''pacman''数据库按照软件包被安装的原因,将其分为两类:<br />
<br />
* '''显式安装''':那些真正地被传递给通用''pacman''{{ic|-S}}和{{ic|-U}}命令的包;<br />
* '''依赖''':那些虽然(一般)从未被传递给''pacman''安装命令,但由于被其它显式安装的包[[Dependency|需要]]从而被隐式安装的包<br />
<br />
当安装软件包时,可以把安装原因强制设为'''依赖''':<br />
<br />
# pacman -S --asdeps ''package_name''<br />
<br />
{{提示|用{{ic|--asdeps}}安装可选依赖将导致如果你[[Pacman/Tips_and_tricks#Removing_unused_packages_.28orphans.29|移除孤立包]],''pacman''将会一同移除剩下的可选依赖。}}<br />
<br />
但是当重新安装该软件包时,安装原因将会被设为软件包所默认的。<br />
<br />
显式安装的软件包列表可用{{ic|pacman -Qe}}获取, 与之互补的已安装的依赖包可用{{ic|pacman -Qd}}获取。<br />
<br />
改变某个已安装软件包的安装原因,可以执行:<br />
<br />
# pacman -D --asdeps ''package_name''<br />
<br />
{{注意|在升级时使用{{ic|--asdeps}}和{{ic|--asexplicit}}选项,例如{{ic|pacman -Syu ''package_name'' --asdeps}},是不被推荐的。这会导致不仅改变要被安装的软件包的安装原因,也会改变被升级的软件包的安装原因。}}<br />
<br />
=== 查询一个包含具体文件的包名 ===<br />
<br />
同步文件数据库:<br />
<br />
# pacman -Fy<br />
<br />
查询包含某个文件的包名,比如:<br />
<br />
# pacman -F pacman<br />
core/pacman 5.0.1-4<br />
usr/bin/pacman<br />
usr/share/bash-completion/completions/pacman<br />
extra/xscreensaver 5.36-1<br />
usr/lib/xscreensaver/pacman<br />
<br />
{{小贴士 | 可以设置一个 {{ic|crontab}} 或者 {{ic|systemd timer}} 来定期同步文件信息数据库。}}<br />
<br />
如果需要高级功能请安装 [[pkgfile]],它使用一个单独的数据库来保存文件和它们所关联的软件包的信息。<br />
<br />
==配置==<br />
''pacman'' 的配置文件位于{{ic|/etc/pacman.conf}}。 [https://www.archlinux.org/pacman/pacman.conf.5.html man pacman.conf] 可以查看配置文件的进一步信息。<br />
<br />
===通用选项===<br />
<br />
通用选项都在{{Ic|[options]}}段。阅读 man 手册或者查看默认的 pacman.conf 可以获得有关信息和用法。<br />
<br />
===升级前对比版本===<br />
要查看旧版和新版的有效安装包,请取消{{ic|/etc/pacman.conf}}中"VerbosePkgLists"的注释。修改后的{{ic|pacman -Syu}}输出如下:<br />
<br />
Package (6) Old Version New Version Net Change Download Size<br />
<br />
extra/libmariadbclient 10.1.9-4 10.1.10-1 0.03 MiB 4.35 MiB<br />
extra/libpng 1.6.19-1 1.6.20-1 0.00 MiB 0.23 MiB<br />
extra/mariadb 10.1.9-4 10.1.10-1 0.26 MiB 13.80 MiB<br />
<br />
====在升级时跳过软件包====<br />
{{警告|在跳过软件包时要小心,因为[[System_maintenance_(简体中文)#不支持部分升级|部分升级不受支持]]}}<br />
<br />
要想在[[#升级软件包|升级]]系统时跳过特定的软件包,用像如下的命令指明:<br />
IgnorePkg=linux<br />
<br />
多软件包可以用空格隔开,或者用另外的{{ic|IgnorePkg}}行。也可使用 [[Wikipedia:glob (programming)|glob]] 模式。如果只打算忽略一次升级,可以使用 {{ic|--ignore}} 选项,这时使用逗号隔开的列表。<br />
<br />
忽略了的软件包依然可通过 {{ic|pacman -S}} 升级。这种情况下''pacman''会提醒你这些软件包已经被包含在{{ic|IgnorePkg}}声明中。<br />
<br />
====在升级时跳过软件包组====<br />
{{警告|在跳过软件包时要小心,因为[[System_maintenance_(简体中文)#不支持部分升级|部分升级不受支持]]}}<br />
<br />
和软件包一样,也可以不升级某个软件包组:<br />
IgnoreGroup = gnome<br />
<br />
==== 在升级时跳过文件 ====<br />
<br />
所有在{{Ic|NoUpgrade}}指令中列出的文件都会在软件包被安装/升级时不会被更改,并且新文件会以带有''.pacnew''后缀名的形式安装<br />
<br />
NoUpgrade=''path/to/file''<br />
<br />
{{注意|这个路径指软件包中的文件,所以不要包括开头的斜线。}}<br />
<br />
==== 在安装时跳过文件 ====<br />
<br />
要总是跳过某些文件夹的安装,可以将它们放到 {{Ic|NoExtract}} 中,例如不想安装 [[systemd]] 模块:<br />
<br />
NoExtract=usr/lib/systemd/system/*<br />
<br />
后面的规则覆盖前面的规则,加上 {{ic|!}} 可以取消跳过效果。<br />
<br />
{{提示|''pacman''会在更新locales已经被''localepurge''或者''bleachbit''清除的包时发出警告。将{{ic|CheckSpace}}参数加入{{ic|pacman.conf}}能够抑制这种警告,但是要意识到space-check功能将会对所有软件包禁用。}}<br />
<br />
===保留多个配置文件===<br />
<br />
如果你有多个配置文件(比如,主配置和启用了[[Official_repositories_(简体中文)#testing_仓库|测试仓库]]的配置文件),需要共享一些设置,你可以在配置文件中使用{{ic|Include}}选项,例如:<br />
<br />
Include = ''/path/to/common/settings''<br />
<br />
{{ic|''/path/to/common/settings''}}文件中是两个配置文件共享的相同配置。<br />
<br />
===Hooks===<br />
''pacman''可以在处理前后,运行{{ic|/usr/share/libalpm/hooks/}}文件夹下的hooks,更多的hooks文件夹可以通过{{ic|HooDir}}选项在{{ic|pacman.conf}}中指明,默认{{ic|/etc/pacman.d/hooks}}。Hook文件必须以''.hook''为后缀。Pacman hooks不是交互式的。<br />
<br />
''pacman'' hooks用于,比如说,和{{ic|systemd-sysusers}}和{{ic|systemd-tmpfiles}}结合来在安装包时自动创建系统用户和文件。例如,{{Pkg|tomcat8}}指明它想要创建一个叫做{{ic|tomcat8}}的系统用户和一些属于该用户的文件。当''pacman''确定{{Pkg|tomcat8}}包含文件指明用户和临时文件时,''pacman'' hooks {{ic|systemd-sysusers.hook}}和{{ic|systemd-tmpfiles.hook}}唤起{{ic|systemd-sysusers}}和{{ic|systemd-tmpfiles}}。<br />
<br />
有关 alpm hooks 的更多信息,参见{{man|5|alpm-hooks}}。<br />
<br />
===软件仓库===<br />
除了特殊的[[#通用选项|通用选项]]节, 每个{{ic|pacman.conf}}中的{{ic|[section]}}都定义了一个使用的软件包仓库,''仓库''是多个软件包的''逻辑''上的集合,他们''物理''上存储在一个或多个服务器:这也是为什么每一个服务器都叫做这个仓库的''镜像''。<br />
<br />
仓库区分为[[Official repositories (简体中文)|官方仓库]]与[[Unofficial user repositories (简体中文)|非官方仓库]]。配置文件中仓库的顺序十分重要;当几个仓库出现同名安装包,不管版本号如何,''pacman''将使用配置文件中排前的仓库。要在添加后使用某个仓库,你需要先[[#升级软件包|升级]]整个系统<br />
<br />
每个仓库节都可以直接指定镜像列表或者{{ic|Include}}引用其他的文件:例如,官方镜像引用了{{ic|/etc/pacman.d/mirrorlist/}}。具体查看[[Mirrors (简体中文)]]。<br />
<br />
=== 软件包的安全性 ===<br />
<br />
''pacman'' 支持软件包签名,会为软件包提供额外的安全性。默认配置,{{ic|1=SigLevel = Required DatabaseOptional}} 将启用全局签名验证,但会被每个软件仓库的 {{ic|SigLevel}} 行所覆盖。有关软件包签名和签名验证的更多细节,参见 [[pacman-key (简体中文)|pacman-key]]。<br />
<br />
== 疑难解答 ==<br />
<br />
=== "Failed to commit transaction (conflicting files)" 错误 ===<br />
<br />
如果碰到如下错误:[https://bbs.archlinux.org/viewtopic.php?id=56373]<br />
<br />
error: could not prepare transaction<br />
error: failed to commit transaction (conflicting files)<br />
package: ''/path/to/file'' exists in filesystem<br />
Errors occurred, no packages were upgraded.<br />
<br />
这是因为 ''pacman'' 检测到文件冲突,而且按照设计,''pacman'' 不会覆盖文件。这是设计功能,不是缺陷。<br />
<br />
这个问题通常很容易解决。一个安全的方式是,首先检查是否有另一个软件包提供了这个文件 ({{Ic|pacman -Qo ''/path/to/file''}})。如果文件被另一个软件包所有,请[[Bug reporting guidelines (简体中文)|报告问题]]。如果不是其它软件包提供,将 'exists in filesystem' 的文件重命名并重新运行update命令。如果一切顺利,可以删掉这个文件。<br />
<br />
如果你手动安装了一个软件,没有通过''pacman'',例如用{{ic|make install}},你必须将软件连同它的全部文件一起移除/卸载。参见[[Pacman/Tips_and_tricks#Identify_files_not_owned_by_any_package]]。<br />
<br />
每一个安装的软件包都会提供一个 {{ic|/var/lib/pacman/local/''$package-$version''/files}} 文件,包含此软件包的元数据。如果文件损坏或者丢失,将会导致升级时出现{{ic|file exists in filesystem}} 错误。此错误通常只会影响一个软件包,除了手动删除或移动所有的问题文件,你也可以显式地使用{{ic|pacman -S --overwrite ''glob package''}}让 ''pacman'' 强制覆盖匹配{{ic|''glob''}}的文件。<br />
<br />
{{警告|尽量避免使用{{ic|--overwrite}}开关。参见[[System_maintenance_(简体中文)#避免某些_Pacman_命令]]}}<br />
<br />
=== "Failed to commit transaction (invalid or corrupted package)" 错误 ===<br />
<br />
看看{{Ic|/var/cache/pacman/pkg}}中是否有{{Ic|*.part}}结尾的文件,它们是没有完全下载的文件,删除它们并重新执行更新。这些程序一般是自定义的{{Ic|XferCommand}} 下载命令造成的。<br />
<br />
# find /var/cache/pacman/pkg/ -iname "*.part" -delete<br />
<br />
=== "Failed to init transaction (unable to lock database)" 错误 ===<br />
<br />
''pacman'' 在改变软件包数据库前,比如安装软件包时,会创建一个文件锁 {{ic|/var/lib/pacman/db.lck}}。这会阻止其他 ''pacman'' 实例在同一时间修改软件包数据库。<br />
<br />
如果 ''pacman'' 在更新数据库时被打断,旧锁可能保留下来。如果确认没有 ''pacman'' 实例在运行,那么删掉文件锁:<br />
<br />
# rm /var/lib/pacman/db.lck<br />
<br />
=== 安装时无法获取软件包 ===<br />
<br />
错误内容包含:{{ic|Not found in sync db}}, {{ic|Target not found}} 或 {{ic|Failed retrieving file}}.<br />
<br />
首先确认软件包确实存在(并注意错别字)。如果确认软件包存在,可能本地数据库过时了或者软件仓库没有配置好,试试 {{ic|pacman -Syyu}} 强制数据库更新和升级。<br />
<br />
也有可能包含该软件包的软件仓库没有启动。例如,该软件包可能在 ''multilib'' 仓库里,但该仓库没有在 ''pacman.conf'' 中启用。<br />
<br />
参阅[[FAQ#Why is there only a single version of each shared library in the official repositories?]].<br />
<br />
=== pacman 更新时崩溃 ===<br />
<br />
如果 ''pacman'' 在删除、重新安装或更新软件包时 "数据库写入" 出错:<br />
# 从 Arch 安装媒体启动,最好用最新的安装媒体<br />
# 挂载根文件系统,例如以 root 身份{{ic|mount /dev/sdaX /mnt}},通过 {{ic|df -h}} 确认根文件目录包含足够的空间<br />
# 同样挂载 proc, sys 和 dev 文件系统:{{ic|mount -t proc proc /mnt/proc; mount --rbind /sys /mnt/sys; mount --rbind /dev /mnt/dev}}<br />
# 如果系统使用默认的数据库目录位置,可以通过 root 用户执行下面命令{{ic|pacman --sysroot /mnt -Syu}}来更新系统的 ''pacman'' 数据库。<br />
# 更新之后,可以通过下面命令确认是否还存在损坏的包:{{ic|find /mnt/usr/lib -size 0}} <br />
# 通过{{ic|pacman --sysroot /mnt -S ''package''}}重新安装依然损坏的软件包<br />
<br />
=== 手动重新安装 pacman ===<br />
<br />
{{警告|这种方式极其容易破坏你的系统,把它变得更糟。这个方式只是作为最后的措施,以防万一[[#pacman 更新时崩溃]]不起作用}}<br />
<br />
即使 ''pacman'' 严重损坏,你仍可以手动修复它,这需要下载最新的包并把它们解压到正确的目录。大致步骤如下:<br />
<br />
# 确定要安装的{{pkg|pacman}}依赖项<br />
# 从你选择的[[mirror]]下载每个包<br />
# 把每个包解压到 root<br />
# 使用{{ic|pacman -S --overwrite}}重新安装这些包来更新相应的软件包数据库<br />
# 进行完整系统更新<br />
<br />
如果你拥有一个健康的 Arch 系统,你可以这样查看依赖项的完整列表:<br />
<br />
$ pacman -Q $(pactree -u pacman)<br />
<br />
但是依据你遇到的问题,你可能只需要更新其中的几个。解压一个包的示例是:<br />
<br />
# tar -xvpwf ''package.tar.xz'' -C / --exclude .PKGINFO --exclude .INSTALL --exclude .MTREE --exclude .BUILDINFO<br />
<br />
注意{{ic|w}}参数表示交互模式。以非交互方式运行是非常冒险的,因为你可能就此覆盖了一个重要文件。你也要注意以正确的顺序解压软件包(例如先解压依赖)。<br />
[https://bbs.archlinux.org/viewtopic.php?id=95007 这个帖子]包含了一些这个过程的例子,这些例子中只有少量''pacman''依赖项损坏。<br />
<br />
=== 升级系统重启后,出现"unable to find root device"错误,无法登陆 ===<br />
<br />
很有可能 [[initramfs]] 在[[kernel (简体中文)|内核]]升级时损坏(例如由错误地使用 ''pacman'' 的 {{ic|--overwrite}} 选项导致)。有两个选择;首先尝试 ''Fallback''启动项。<br />
<br />
{{小贴士|万一你删除了 ''Fallback'' 启动项,你总可以在启动加载器菜单显示出来的时候按{{ic|Tab}}键(对于 Syslinux)或者按{{ic|e}}键(对于 GRUB 或者 systemd-boot),将它重命名为{{ic|initramfs-linux-fallback.img}}然后按{{ic|Enter}}或者{{ic|b}}(取决于你的[[启动加载器]]以新参数启动的方式)}}<br />
<br />
一旦系统启动,从控制台或终端(为备用{{Pkg|linux}}内核)运行这条命令来重建 initramfs 映像:<br />
<br />
# mkinitcpio -p linux<br />
<br />
如果上面方法不行,从一个当前的 Arch 发行(CD/DVD 或者 U盘),[[挂载]]你的根目录和启动分区,然后用 ''arch-chroot'' [[chroot]]<br />
<br />
# arch-chroot /mnt<br />
# pacman -Syu mkinitcpio systemd linux<br />
<br />
{{注意|<br />
* 如果你没有一个当前的发行或者你只有某些其他的 "live" Linux 发行版,你可以用老式的方法[[chroot]]。显然,这种方式比简单地运行{{ic|arch-chroot}}脚本需要更多的输入<br />
* 如果 ''pacman'' 伴随{{ic|Could not resolve host}}运行失败,请[[Network_configuration_(简体中文)#检查连接|检查你的网络连接]]<br />
* 如果无法进入 arch-chroot 或 chroot 环境,但是需要重新安装软件包,可以使用 {{ic|pacman --sysroot /mnt -Syu foo bar}} 从而在你的根分区下使用 ''pacman'' }}<br />
<br />
重新安装内核({{Pkg|linux}} 软件包)将会自动运行 {{ic|mkinitcpio -p linux}} 重新生成 initramfs 镜像,不需要单独生成。<br />
<br />
之后建议执行 {{ic|exit}}, {{ic|umount /mnt/{boot,} }} 然后 {{ic|reboot}}.<br />
<br />
=== Signature from "User <email@gmail.com>" is unknown trust, installation failed ===<br />
<br />
试试以下途径:<br />
* 更新已知密钥:{{ic|pacman-key --refresh-keys}};<br />
* 手动升级{{ic|archlinux-keyring}}软件包:{{ic|pacman -Sy archlinux-keyring && pacman -Su}}.<br />
* 查看[[pacman-key#Resetting all the keys]].<br />
<br />
=== 请求导入 PGP keys ===<br />
<br />
如果用过时的 ISO [[Installation_guide_(简体中文)|安装]] Arch,你很有可能被提示要导入 PGP keys。同意下载密钥来继续。如果你无法成功添加 PGP keys,更新或升级 keyring {{Pkg|archlinux-keyring}} (浏览 [[#Signature from "User <email@gmail.com>" is unknown trust, installation failed|above]]).<br />
<br />
=== Error: key "0123456789ABCDEF" could not be looked up remotely ===<br />
<br />
If packages are signed with new keys, which were only recently added to {{Pkg|archlinux-keyring}}, these keys are not locally available during update (chicken-egg-problem). The installed {{Pkg|archlinux-keyring}} does not contain the key, until it is updated. Pacman tries to bypass this by a lookup through a key-server, which might not be possible e.g. behind proxys or firewalls and results in the stated error. Upgrade {{Pkg|archlinux-keyring}} first as shown [[#Signature from "User <email@example.org>" is unknown trust, installation failed|above]].<br />
<br />
=== 不停看到错误 "PackageName: signature from "User <email@archlinux.org>" is invalid" ===<br />
<br />
当系统时间错误时,签名密钥将会被认为过期(或无效)并且签名检查将会失败,提示以下错误信息:<br />
<br />
error: PackageName: signature from "User <email@archlinux.org>" is invalid<br />
error: failed to commit transaction (invalid or corrupted package (PGP signature))<br />
Errors occured, no packages were upgraded. <br />
<br />
确保矫正[[System_time_(简体中文)|系统时间]],例如在安装或升级前从 root 执行 {{ic|ntpd -qg}} ,和 {{ic|hwclock -w}}。<br />
<br />
=== 'warning: current locale is invalid; using default "C" locale' 错误 ===<br />
<br />
错误信息已经很明确了,locale 设置不正确,请阅读[[Locale]]进行设置。<br />
<br />
=== Pacman 不使用我的代理设置 ===<br />
<br />
正确设置环境变量({{ic|$http_proxy}}, {{ic|$ftp_proxy}} 等)如果使用 [[sudo]],需要让 sudo [[sudo#Environment variables|将这些变量传递给 pacman]].<br />
<br />
=== 如何重装所有包并保留安装和依赖信息? ===<br />
重装所有软件包:{{ic|pacman -S $(pacman -Qnq)}}({{ic|-S}} 选项会保留安装缘由)。<br />
<br />
接着需要重装外来包(不在官方仓库里的软件包)。外来包可通过{{ic|pacman -Qmq}}查看。<br />
<br />
=== "Cannot open shared object file" 错误 ===<br />
<br />
有可能是前一次 ''pacman'' 事务中删除或者损坏了 pacman 自身需要的一些共享库。<br />
<br />
要修复这种情况,你需要手动解压那些共享库文件到文件系统中合适的地方。首先请查明哪个包中包含有所需的库文件,然后在 ''pacman'' 缓存中 ({{ic|/var/cache/pacman/pkg/}}) 找到对应的包。解压出需要的库文件到文件系统的对应位置,如此可以继续使用 ''pacman'' 。<br />
<br />
之后需要重新安装损坏的软件包。注意你可能需要使用 {{ic|--overwrite}} 选项覆盖掉你刚刚解压出的系统文件,因为 ''pacman'' 可能没有跟踪到对应的文件信息。 ''pacman'' 随后会使用包中的文件正确替换掉共享库文件。如此能修好您的 pacman ,然后请继续更新系统中剩下的软件包。<br />
<br />
=== 软件包下载停滞 ===<br />
<br />
Some issues have been reported regarding network problems that prevent ''pacman'' from updating/synchronizing repositories. [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] [https://bbs.archlinux.org/viewtopic.php?id&#61;65728] When installing Arch Linux natively, these issues have been resolved by replacing the default ''pacman'' file downloader with an alternative (see [[Improve pacman performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using ''Host interface'' instead of ''NAT'' in the machine properties.<br />
<br />
=== 无法从镜像服务器获取 'core.db' ===<br />
<br />
如果从正确的[[mirrors|镜像服务器]]收到此错误,请换一个[[Resolv.conf|域名解析服务器]]。<br />
<br />
=== error: 'local-package.pkg.tar': permission denied ===<br />
<br />
如果你想要在一个 sshfs 上使用{{ic|pacman -U}}安装软件包并遇到了这个错误,将包移动到本地目录,再试一次。<br />
<br />
== 另请参见 ==<br />
<br />
* [https://www.archlinux.org/pacman/ Pacman Home Page]<br />
* {{man|3|libalpm}}<br />
* {{man|8|pacman}}<br />
* {{man|5|pacman.conf}}<br />
* {{man|8|repo-add}}</div>Cjc7373https://wiki.archlinux.org/index.php?title=Pacman_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=641165Pacman (简体中文)2020-11-10T05:38:01Z<p>Cjc7373: /* pacman不使用我的代理设置 */ update formats</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package management (简体中文)]]<br />
[[Category:Arch projects (简体中文)]]<br />
[[Category:Commands (简体中文)]]<br />
[[ar:Pacman]]<br />
[[cs:Pacman]]<br />
[[da:Pacman]]<br />
[[de:Pacman]]<br />
[[el:Pacman]]<br />
[[en:Pacman]]<br />
[[es:Pacman]]<br />
[[fa:Pacman]]<br />
[[fr:Pacman]]<br />
[[id:Pacman]]<br />
[[it:Pacman]]<br />
[[ja:Pacman]]<br />
[[ko:Pacman]]<br />
[[nl:Pacman]]<br />
[[pl:Pacman]]<br />
[[pt:Pacman]]<br />
[[ru:Pacman]]<br />
[[sr:Pacman]]<br />
[[sv:Pacman]]<br />
[[zh-hant:Pacman]]<br />
{{Related articles start (简体中文)}}<br />
{{Related|Creating packages (简体中文)}}<br />
{{Related|软件包降级}}<br />
{{Related|pacman/Package signing (简体中文)}}<br />
{{Related|pacman/Pacnew and Pacsave (简体中文)}}<br />
{{Related|pacman/Rosetta (简体中文)}}<br />
{{Related|pacman/Tips and tricks (简体中文)}}<br />
{{Related|FAQ (简体中文)}}<br />
{{Related|System maintenance (简体中文)}}<br />
{{Related|Arch Build System (简体中文)}}<br />
{{Related|Official repositories (简体中文)}}<br />
{{Related|Arch User Repository (简体中文)}}<br />
{{Related articles end}}<br />
{{TranslationStatus (简体中文)|pacman|2020-10-20|639260}}<br />
[https://archlinux.org/pacman/ pacman][[Wikipedia:Package management system|软件包管理器]]是 Arch Linux 的一大亮点。它将一个简单的二进制包格式和易用的[[Arch Build System (简体中文)|构建系统]]结合了起来。''pacman''的目标是简化对软件包的管理,无论软件包是来自[[Official repositories (简体中文)|官方软件仓库]]还是来自用户自己的创建。<br />
<br />
''pacman'' 通过和主服务器同步软件包列表来进行系统更新。这种服务器/客户端模式可在使用一条命令就下载或安装软件包的同时,也安装其必需的依赖包。<br />
<br />
''pacman'' 用 [[C (简体中文)|C 语言]]编写,使用{{man|1|bsdtar}}[[w:tar (computing)|tar]]作为打包格式。<br />
<br />
{{小贴士|1={{Pkg|pacman}} 软件包除提供了[[makepkg (简体中文)|makepkg]]和{{man|8|vercmp}}等工具外,其它的有用工具如 '''pactree'''、[[System maintenance (简体中文)#不支持部分升级|checkupdates]]等可在{{Pkg|pacman-contrib}}([https://git.archlinux.org/pacman.git/commit/?id=0c99eabd50752310f42ec808c8734a338122ec86 曾]是 ''pacman'' 的内置工具)中找到。你可以通过 {{ic|pacman -Ql pacman {{!}} grep -E 'bin/.+'}} 获取全部的工具列表。}}<br />
<br />
==用法==<br />
<br />
下面''pacman''可以执行的操作的一小部分,''pacman'' 的其他示例请阅读{{man|8|pacman}}。<br />
<br />
{{小贴士|使用过其它发行版的用户,可以参考 [[Pacman Rosetta]] 中的对比.}}<br />
<br />
===安装软件包===<br />
<br />
一个软件包是一个归档,它包含:<br />
* 一个应用的所有(编译好的)文件<br />
* 有关该应用的元数据,例如应用名称,版本,依赖……<br />
* 供 pacman 使用的安装文件和指令<br />
* (可选)使软件更易操作的额外文件,例如启动/终止脚本<br />
<br />
Arch 的软件包管理器 pacman 可以安装,更新,和删除这些软件包。使用软件包而不是自己编译安装有如下优势:<br />
* 轻松升级:pacman 会在更新可用时立即更新已安装的软件包<br />
* 依赖检查:pacman 负责为你处理依赖问题,你只需要指明程序,pacman 就会把它和它所需的所有其他程序都一起安装。<br />
* 干净卸载:pacman 有着一个软件包所有文件的列表。这样,当你决定移除软件包时,不会无意留下文件。<br />
<br />
{{注意|软件包通常有很多[[PKGBUILD#optdepends|可选依赖]], 它们为软件提供额外功能, 并不强制要求安装它们。 安装软件时, ''pacman'' 将会输出它的可选依赖, 但是这个输出不会在 {{ic|pacman.log}}中;当你想浏览已安装软件的可选依赖时可以使用{{ic|pacman -Si}} ,得到关于可选依赖的简短描述。}}<br />
<br />
{{警告|1=在Arch下安装软件包时,未[[#升级软件包|更新]]系统前,'''不要'''更新软件包数据库(例如,可能出现某软件包不再出现在官方库)。操作时,应使用{{ic|pacman -Syu ''package_name''}}, 而不要使用({{ic|pacman -Sy ''package_name''}}),否则可能会有依赖问题。参见 [[System maintenance (简体中文)#不支持部分升级]] 和 [https://bbs.archlinux.org/viewtopic.php?id=89328 BBS#89328].}}<br />
<br />
====安装指定的包====<br />
安装或者升级单个软件包,或者一列软件包(包含依赖包),使用如下命令:<br />
<br />
# pacman -S ''package_name1'' ''package_name2'' ''...''<br />
<br />
用正则表达式安装多个软件包(参见 [https://bbs.archlinux.org/viewtopic.php?id=7179 这个帖子]):<br />
<br />
# pacman -S $(pacman -Ssq ''package_regex'')<br />
<br />
有时候在不同的软件仓库中,一个软件包有多个版本(比如[extra]和[testing])。可以选择一个来安装:<br />
<br />
# pacman -S extra/''package_name''<br />
<br />
安装多个含有相似名称的软件包,而并非整个包组或全部匹配的软件包; 例如,{{Grp|plasma}}:<br />
<br />
# pacman -S plasma-{desktop,mediacenter,nm}<br />
<br />
当然,可以多层扩展,并不作限制:<br />
<br />
# pacman -S plasma-{workspace{,-wallpapers},pa}<br />
<br />
===== 虚包 =====<br />
<br />
虚拟软件包是一个特殊的软件包,它本身并不存在,但由一或多个其它软件包提供。虚拟软件包允许其它软件包不以某一个特定的包为依赖,以应对有多个候选的情况。虚包不能用它们的名称安装,相反它们会在你安装''提供''虚包的软件包时被安装到你的系统中。<br />
<br />
====安装包组====<br />
<br />
一些包属于一个可以同时安装的[[Meta_package_and_package_group_(简体中文)|软件包组]]。例如,运行下面的命令<br />
<br />
# pacman -S gnome<br />
<br />
会提醒用户选择 {{ic|gnome}} 内需要安装的包。<br />
<br />
有的包组包含大量的软件包,有时用户只需其中几个。除了逐一键入序号外,pacman 还支持选择或排除某个区间内的的软件包:<br />
<br />
Enter a selection (default=all): 1-10 15<br />
<br />
这将选中序号 1 至 10 和 15 的软件包。而<br />
<br />
Enter a selection (default=all): ^5-8 ^2<br />
<br />
将会选中除了序号 5 至 8 和 2 之外的所有软件包。<br />
<br />
想要查看哪些包属于 gnome 组,运行:<br />
<br />
# pacman -Sg gnome<br />
<br />
也可以访问 https://www.archlinux.org/groups/ 查看可用的包组。<br />
<br />
{{注意|如果列表中的包已经安装在系统中,它会被重新安装,即使它已经是最新的。可以用 {{ic|--needed}} 选项覆盖这种行为。}}<br />
<br />
===删除软件包===<br />
<br />
删除单个软件包,保留其全部已经安装的依赖关系<br />
<br />
# pacman -R ''package_name''<br />
<br />
删除指定软件包,及其所有没有被其他已安装软件包使用的依赖关系:<br />
<br />
# pacman -Rs ''package_name''<br />
<br />
上面这条命令在移除包含其他所需包的组时有时候会拒绝运行。这种情况下可以尝试<br />
<br />
# pacman -Rsu ''package_name''<br />
<br />
要删除软件包和所有依赖这个软件包的程序:<br />
<br />
{{警告|此操作是递归的,请小心检查,可能会一次删除大量的软件包。}}<br />
<br />
# pacman -Rsc ''package_name''<br />
<br />
要删除一个被其他软件包依赖的软件包,但是不删除依赖这个软件包的其他软件包:<br />
<br />
{{警告|此操作有破坏系统的能力,应该尽量避免使用。详情请看 [[System maintenance#Avoid certain pacman commands|避免某些 Pacman 命令]]。}}<br />
<br />
# pacman -Rdd ''package_name''<br />
<br />
''pacman'' 删除某些程序时会备份重要配置文件,在其后面加上*.pacsave扩展名。-n 选项可以避免备份这些文件:<br />
<br />
pacman -Rn ''package_name''<br />
<br />
{{注意|''pacman'' 不会删除软件自己创建的文件(例如主目录中的“点文件”不会被删除。)}}<br />
<br />
=== 升级软件包 ===<br />
{{警告|<br />
* 建议用户遵守[[System_maintenance_(简体中文)#更新系统]]的指导,定期更新系统,并不盲目地执行这些命令。<br />
* Arch 只支持系统完整升级,详细参见[[System_maintenance_(简体中文)#不支持部分升级]]和[[#安装软件包]]。}}<br />
<br />
一个 ''pacman'' 命令就可以升级整个系统。花费的时间取决于系统有多老。这个命令会同步非本地(local)软件仓库并升级系统的软件包:<br />
<br />
# pacman -Syu<br />
<br />
===查询包数据库===<br />
<br />
''pacman'' 使用 {{ic|-Q}} 参数查询本地软件包数据库, {{ic|-S}} 查询同步数据库,以及 {{ic|-F}}查询文件数据库。要了解每个参数的子选项,分别参见 {{pacman -Q --help}},{{pacman -S --help}}和{{pacman -F --help}}。<br />
<br />
''pacman'' 可以在包数据库中查询软件包,查询位置包含了软件包的名字和描述:<br />
<br />
$ pacman -Ss ''string1'' ''string2'' ...<br />
<br />
有时,{{Ic|-s}}的内置正则会匹配很多不需要的结果,所以应当指定仅搜索包名,而非描述或其他子段:<br />
<br />
$ pacman -Ss '^vim-'<br />
<br />
要查询已安装的软件包:<br />
<br />
$ pacman -Qs ''string1'' ''string2'' ...<br />
<br />
按文件名查找软件库:<br />
<br />
$ pacman -F ''string1'' ''string2'' ...<br />
<br />
显示软件包的详尽的信息:<br />
<br />
$ pacman -Si ''package_name''<br />
<br />
查询本地安装包的详细信息:<br />
<br />
$ pacman -Qi ''package_name''<br />
<br />
使用两个 {{ic|-i}} 将同时显示备份文件和修改状态:<br />
<br />
$ pacman -Qii ''package_name''<br />
<br />
要获取已安装软件包所包含文件的列表:<br />
<br />
$ pacman -Ql ''package_name''<br />
<br />
查询远程库中软件包包含的文件:<br />
<br />
$ pacman -Fl ''package_name''<br />
<br />
检查软件包安装的文件是否都存在:<br />
<br />
$ pacman -Qk ''package_name''<br />
<br />
两个参数{{ic|k}}将会执行一次更彻底的检查。<br />
查询数据库获取某个文件属于哪个软件包:<br />
<br />
$ pacman -Qo ''/path/to/file_name''<br />
<br />
查询文件属于远程数据库中的哪个软件包:<br />
<br />
$ pacman -F ''/path/to/file_name''<br />
<br />
要罗列所有不再作为依赖的软件包(孤立orphans):<br />
<br />
$ pacman -Qdt<br />
<br />
{{提示|将上述命令添加到 pacman 的一个处理后 [[#Hooks|hook]]用于在如果有处理产生孤立包后获得提示。这在当有软件包被仓库放弃时是有用的,因为任何被抛弃的包都会成为本地的一个孤立包(除非它是被显式安装的)。要避免在没有找到孤立包时"failed to execute command”的错误,在你的 hook 中为{{ic|Exec}}使用如下的指令: {{ic|<nowiki>/usr/bin/bash -c "/usr/bin/pacman -Qtd || /usr/bin/echo '=> None found.'"</nowiki>}}}}<br />
<br />
要罗列所有明确安装而且不被其它包依赖的软件包:<br />
<br />
$ pacman -Qet<br />
<br />
更多例子查看[[pacman tips]]。<br />
<br />
==== Pactree ====<br />
{{注意|{{man|8|pactree}}不再是{{Pkg|pacman}}的一部分。它现在在{{Pkg|pacman-contrib}}中。}}<br />
<br />
要显示软件包的依赖树:<br />
<br />
$ pactree ''package_name''<br />
<br />
检查一个''安装''的软件包被那些包依赖,将递归标识{{ic|-r}}传递给 ''pactree'',或者使用 {{AUR|pkgtools}}中的''whoneeds''<br />
<br />
==== 数据库结构 ====<br />
<br />
pacman数据库通常位于 {{ic|/var/lib/pacman/sync}}. 对于每一个在{{ic|/etc/pacman.conf}}中指定的软件仓库, 这里都有一个一致的数据库。数据库文件夹里每个tar.gz文件都包含着一个仓库的软件包信息。例如{{Pkg|which}} 包:<br />
<br />
{{hc|$ tree which-2.21-5|<br />
which-2.21-5<br />
{{!}}-- desc<br />
}}<br />
<br />
这个 {{ic|depends}} 项列出了该软件的依赖包, 而{{ic|desc}}有该包的介绍,例如文件大小和MD5值 。<br />
<br />
=== 清理软件包缓存 ===<br />
<br />
''pacman'' 将下载的软件包保存在 {{ic|/var/cache/pacman/pkg/}} 并且不会自动移除旧的和未安装版本的软件包。这样做有一些好处:<br />
# 这样允许[[Downgrading packages (简体中文)|降级]]软件包而不需要通过其他方式提取旧版本,例如 [[Arch Linux Archive (简体中文)|Arch Linux Archive]].<br />
# 被卸载的软件包可以轻易地直接从缓存文件夹重新安装,不需要重新从软件仓库下载。<br />
<br />
然而,需要定期手动清理缓存来避免该文件夹无限制增大。<br />
<br />
{{Pkg|pacman-contrib}} 提供的 {{man|8|paccache}} 脚本默认会删除所有缓存的版本和已卸载的软件包,除了最近的3个会被保留:<br />
<br />
# paccache -r<br />
<br />
[[Enable|启用]] 和 [[start|启动]] {{ic|paccache.timer}}来每周删除不使用的包。<br />
<br />
{{提示|1=可以使用 [[#Hooks|hook]] 自动执行清理,参考[https://bbs.archlinux.org/viewtopic.php?pid=1694743#p1694743]和{{AUR|pacman-cleanup-hook}}。}}<br />
<br />
也可以自己设置保留最近几个版本:<br />
<br />
# paccache -rk1<br />
<br />
添加{{ic|-u}}/{{ic|--uninstalled}}开关来限制''paccache''的行为只作用于卸载的包。例如清理所有卸载的包的缓存版本,可以用以下命令:<br />
<br />
# paccache -ruk0<br />
<br />
或者你可以将安装其结合,同时作用于安装的和卸载的包,例如想要保留最近两个安装的包但是移除所有卸载的包的缓存版本,使用以下命令:<br />
# paccache -rk2 -ruk0<br />
<br />
更多参数参见{{ic|paccache -h}}。<br />
<br />
''pacman''也有一些内建参数用于清除缓存和那些不再在{{ic|/etc/pacman.conf}}配置文件中列出的软件仓库残留数据库文件。然而''pacman''并不提供保留一定数量的过去版本的功能,因此它比''paccache''的默认选项更加激进。<br />
<br />
要删除目前没有安装的所有缓存的包,和没有被使用的同步数据库,执行:<br />
<br />
# pacman -Sc<br />
<br />
要删除缓存中的全部文件,使用两次{{ic|-c}}开关。这是最为激进的方式,将会清空缓存文件夹:<br />
<br />
# pacman -Scc<br />
<br />
{{警告|应当避免从缓存中删除所有过去版本和卸载的包,除非需要更多磁盘空间。这样会导致无法降级或重新安装包而不再次下载他们}}<br />
<br />
{{AUR|pkgcacheclean}}以及{{AUR|pacleaner}}是两个进一步清理缓存的替代工具<br />
<br />
===其它命令===<br />
<br />
升级系统时安装其他软件包:<br />
<br />
# pacman -Syu ''package_name1'' ''package_name2'' ...<br />
<br />
下载包而不安装它:<br />
# pacman -Sw package_name<br />
<br />
安装一个'''本地'''包(不从源里下载):<br />
# pacman -U ''/path/to/package/package_name-version.pkg.tar.xz''<br />
<br />
要将本地包保存至缓存,可执行:<br />
# pacman -U file:///''path/to/package/package_name-version.pkg.tar.xz''<br />
<br />
安装一个'''远程'''包(不在 ''pacman'' 配置的源里面):<br />
# pacman -U ''<nowiki>http://www.example.com/repo/example.pkg.tar.xz</nowiki>''<br />
<br />
要禁用 {{ic|-S}}, {{ic|-U}} 和 {{ic|-R}} 动作,可以使用 {{ic|-p}} 选项.<br />
<br />
''pacman'' 会列出需要安装和删除的软件,并在执行动作前要求需要的权限。<br />
<br />
===安装原因===<br />
''pacman''数据库按照软件包被安装的原因,将其分为两类:<br />
<br />
* '''显式安装''':那些真正地被传递给通用''pacman''{{ic|-S}}和{{ic|-U}}命令的包;<br />
* '''依赖''':那些虽然(一般)从未被传递给''pacman''安装命令,但由于被其它显式安装的包[[Dependency|需要]]从而被隐式安装的包<br />
<br />
当安装软件包时,可以把安装原因强制设为'''依赖''':<br />
<br />
# pacman -S --asdeps ''package_name''<br />
<br />
{{提示|用{{ic|--asdeps}}安装可选依赖将导致如果你[[Pacman/Tips_and_tricks#Removing_unused_packages_.28orphans.29|移除孤立包]],''pacman''将会一同移除剩下的可选依赖。}}<br />
<br />
但是当重新安装该软件包时,安装原因将会被设为软件包所默认的。<br />
<br />
显式安装的软件包列表可用{{ic|pacman -Qe}}获取, 与之互补的已安装的依赖包可用{{ic|pacman -Qd}}获取。<br />
<br />
改变某个已安装软件包的安装原因,可以执行:<br />
<br />
# pacman -D --asdeps ''package_name''<br />
<br />
{{注意|在升级时使用{{ic|--asdeps}}和{{ic|--asexplicit}}选项,例如{{ic|pacman -Syu ''package_name'' --asdeps}},是不被推荐的。这会导致不仅改变要被安装的软件包的安装原因,也会改变被升级的软件包的安装原因。}}<br />
<br />
=== 查询一个包含具体文件的包名 ===<br />
<br />
同步文件数据库:<br />
<br />
# pacman -Fy<br />
<br />
查询包含某个文件的包名,比如:<br />
<br />
# pacman -F pacman<br />
core/pacman 5.0.1-4<br />
usr/bin/pacman<br />
usr/share/bash-completion/completions/pacman<br />
extra/xscreensaver 5.36-1<br />
usr/lib/xscreensaver/pacman<br />
<br />
{{小贴士 | 可以设置一个 {{ic|crontab}} 或者 {{ic|systemd timer}} 来定期同步文件信息数据库。}}<br />
<br />
如果需要高级功能请安装 [[pkgfile]],它使用一个单独的数据库来保存文件和它们所关联的软件包的信息。<br />
<br />
==配置==<br />
''pacman'' 的配置文件位于{{ic|/etc/pacman.conf}}。 [https://www.archlinux.org/pacman/pacman.conf.5.html man pacman.conf] 可以查看配置文件的进一步信息。<br />
<br />
===通用选项===<br />
<br />
通用选项都在{{Ic|[options]}}段。阅读 man 手册或者查看默认的 pacman.conf 可以获得有关信息和用法。<br />
<br />
===升级前对比版本===<br />
要查看旧版和新版的有效安装包,请取消{{ic|/etc/pacman.conf}}中"VerbosePkgLists"的注释。修改后的{{ic|pacman -Syu}}输出如下:<br />
<br />
Package (6) Old Version New Version Net Change Download Size<br />
<br />
extra/libmariadbclient 10.1.9-4 10.1.10-1 0.03 MiB 4.35 MiB<br />
extra/libpng 1.6.19-1 1.6.20-1 0.00 MiB 0.23 MiB<br />
extra/mariadb 10.1.9-4 10.1.10-1 0.26 MiB 13.80 MiB<br />
<br />
====在升级时跳过软件包====<br />
{{警告|在跳过软件包时要小心,因为[[System_maintenance_(简体中文)#不支持部分升级|部分升级不受支持]]}}<br />
<br />
要想在[[#升级软件包|升级]]系统时跳过特定的软件包,用像如下的命令指明:<br />
IgnorePkg=linux<br />
<br />
多软件包可以用空格隔开,或者用另外的{{ic|IgnorePkg}}行。也可使用 [[Wikipedia:glob (programming)|glob]] 模式。如果只打算忽略一次升级,可以使用 {{ic|--ignore}} 选项,这时使用逗号隔开的列表。<br />
<br />
忽略了的软件包依然可通过 {{ic|pacman -S}} 升级。这种情况下''pacman''会提醒你这些软件包已经被包含在{{ic|IgnorePkg}}声明中。<br />
<br />
====在升级时跳过软件包组====<br />
{{警告|在跳过软件包时要小心,因为[[System_maintenance_(简体中文)#不支持部分升级|部分升级不受支持]]}}<br />
<br />
和软件包一样,也可以不升级某个软件包组:<br />
IgnoreGroup = gnome<br />
<br />
==== 在升级时跳过文件 ====<br />
<br />
所有在{{Ic|NoUpgrade}}指令中列出的文件都会在软件包被安装/升级时不会被更改,并且新文件会以带有''.pacnew''后缀名的形式安装<br />
<br />
NoUpgrade=''path/to/file''<br />
<br />
{{注意|这个路径指软件包中的文件,所以不要包括开头的斜线。}}<br />
<br />
==== 在安装时跳过文件 ====<br />
<br />
要总是跳过某些文件夹的安装,可以将它们放到 {{Ic|NoExtract}} 中,例如不想安装 [[systemd]] 模块:<br />
<br />
NoExtract=usr/lib/systemd/system/*<br />
<br />
后面的规则覆盖前面的规则,加上 {{ic|!}} 可以取消跳过效果。<br />
<br />
{{提示|''pacman''会在更新locales已经被''localepurge''或者''bleachbit''清除的包时发出警告。将{{ic|CheckSpace}}参数加入{{ic|pacman.conf}}能够抑制这种警告,但是要意识到space-check功能将会对所有软件包禁用。}}<br />
<br />
===保留多个配置文件===<br />
<br />
如果你有多个配置文件(比如,主配置和启用了[[Official_repositories_(简体中文)#testing_仓库|测试仓库]]的配置文件),需要共享一些设置,你可以在配置文件中使用{{ic|Include}}选项,例如:<br />
<br />
Include = ''/path/to/common/settings''<br />
<br />
{{ic|''/path/to/common/settings''}}文件中是两个配置文件共享的相同配置。<br />
<br />
===Hooks===<br />
''pacman''可以在处理前后,运行{{ic|/usr/share/libalpm/hooks/}}文件夹下的hooks,更多的hooks文件夹可以通过{{ic|HooDir}}选项在{{ic|pacman.conf}}中指明,默认{{ic|/etc/pacman.d/hooks}}。Hook文件必须以''.hook''为后缀。Pacman hooks不是交互式的。<br />
<br />
''pacman'' hooks用于,比如说,和{{ic|systemd-sysusers}}和{{ic|systemd-tmpfiles}}结合来在安装包时自动创建系统用户和文件。例如,{{Pkg|tomcat8}}指明它想要创建一个叫做{{ic|tomcat8}}的系统用户和一些属于该用户的文件。当''pacman''确定{{Pkg|tomcat8}}包含文件指明用户和临时文件时,''pacman'' hooks {{ic|systemd-sysusers.hook}}和{{ic|systemd-tmpfiles.hook}}唤起{{ic|systemd-sysusers}}和{{ic|systemd-tmpfiles}}。<br />
<br />
有关 alpm hooks 的更多信息,参见{{man|5|alpm-hooks}}。<br />
<br />
===软件仓库===<br />
除了特殊的[[#通用选项|通用选项]]节, 每个{{ic|pacman.conf}}中的{{ic|[section]}}都定义了一个使用的软件包仓库,''仓库''是多个软件包的''逻辑''上的集合,他们''物理''上存储在一个或多个服务器:这也是为什么每一个服务器都叫做这个仓库的''镜像''。<br />
<br />
仓库区分为[[Official repositories (简体中文)|官方仓库]]与[[Unofficial user repositories (简体中文)|非官方仓库]]。配置文件中仓库的顺序十分重要;当几个仓库出现同名安装包,不管版本号如何,''pacman''将使用配置文件中排前的仓库。要在添加后使用某个仓库,你需要先[[#升级软件包|升级]]整个系统<br />
<br />
每个仓库节都可以直接指定镜像列表或者{{ic|Include}}引用其他的文件:例如,官方镜像引用了{{ic|/etc/pacman.d/mirrorlist/}}。具体查看[[Mirrors (简体中文)]]。<br />
<br />
=== 软件包的安全性 ===<br />
<br />
''pacman'' 支持软件包签名,会为软件包提供额外的安全性。默认配置,{{ic|1=SigLevel = Required DatabaseOptional}} 将启用全局签名验证,但会被每个软件仓库的 {{ic|SigLevel}} 行所覆盖。有关软件包签名和签名验证的更多细节,参见 [[pacman-key (简体中文)|pacman-key]]。<br />
<br />
== 疑难解答 ==<br />
<br />
=== "Failed to commit transaction (conflicting files)" 错误 ===<br />
<br />
如果碰到如下错误:[https://bbs.archlinux.org/viewtopic.php?id=56373]<br />
<br />
error: could not prepare transaction<br />
error: failed to commit transaction (conflicting files)<br />
package: ''/path/to/file'' exists in filesystem<br />
Errors occurred, no packages were upgraded.<br />
<br />
这是因为 ''pacman'' 检测到文件冲突,而且按照设计,''pacman'' 不会覆盖文件。这是设计功能,不是缺陷。<br />
<br />
这个问题通常很容易解决。一个安全的方式是,首先检查是否有另一个软件包提供了这个文件 ({{Ic|pacman -Qo ''/path/to/file''}})。如果文件被另一个软件包所有,请[[Bug reporting guidelines (简体中文)|报告问题]]。如果不是其它软件包提供,将 'exists in filesystem' 的文件重命名并重新运行update命令。如果一切顺利,可以删掉这个文件。<br />
<br />
如果你手动安装了一个软件,没有通过''pacman'',例如用{{ic|make install}},你必须将软件连同它的全部文件一起移除/卸载。参见[[Pacman/Tips_and_tricks#Identify_files_not_owned_by_any_package]]。<br />
<br />
每一个安装的软件包都会提供一个 {{ic|/var/lib/pacman/local/''$package-$version''/files}} 文件,包含此软件包的元数据。如果文件损坏或者丢失,将会导致升级时出现{{ic|file exists in filesystem}} 错误。此错误通常只会影响一个软件包,除了手动删除或移动所有的问题文件,你也可以显式地使用{{ic|pacman -S --overwrite ''glob package''}}让 ''pacman'' 强制覆盖匹配{{ic|''glob''}}的文件。<br />
<br />
{{警告|尽量避免使用{{ic|--overwrite}}开关。参见[[System_maintenance_(简体中文)#避免某些_Pacman_命令]]}}<br />
<br />
=== "Failed to commit transaction (invalid or corrupted package)" 错误 ===<br />
<br />
看看{{Ic|/var/cache/pacman/pkg}}中是否有{{Ic|*.part}}结尾的文件,它们是没有完全下载的文件,删除它们并重新执行更新。这些程序一般是自定义的{{Ic|XferCommand}} 下载命令造成的。<br />
<br />
# find /var/cache/pacman/pkg/ -iname "*.part" -delete<br />
<br />
=== "Failed to init transaction (unable to lock database)" 错误 ===<br />
<br />
''pacman'' 在改变软件包数据库前,比如安装软件包时,会创建一个文件锁 {{ic|/var/lib/pacman/db.lck}}。这会阻止其他 ''pacman'' 实例在同一时间修改软件包数据库。<br />
<br />
如果 ''pacman'' 在更新数据库时被打断,旧锁可能保留下来。如果确认没有 ''pacman'' 实例在运行,那么删掉文件锁:<br />
<br />
# rm /var/lib/pacman/db.lck<br />
<br />
=== 安装时无法获取软件包 ===<br />
<br />
错误内容包含:{{ic|Not found in sync db}}, {{ic|Target not found}} 或 {{ic|Failed retrieving file}}.<br />
<br />
首先确认软件包确实存在(并注意错别字)。如果确认软件包存在,可能本地数据库过时了或者软件仓库没有配置好,试试 {{ic|pacman -Syyu}} 强制数据库更新和升级。<br />
<br />
也有可能包含该软件包的软件仓库没有启动。例如,该软件包可能在 ''multilib'' 仓库里,但该仓库没有在 ''pacman.conf'' 中启用。<br />
<br />
参阅[[FAQ#Why is there only a single version of each shared library in the official repositories?]].<br />
<br />
=== pacman 更新时崩溃 ===<br />
<br />
如果 ''pacman'' 在删除、重新安装或更新软件包时 "数据库写入" 出错:<br />
# 从 Arch 安装媒体启动,最好用最新的安装媒体<br />
# 挂载根文件系统,例如以 root 身份{{ic|mount /dev/sdaX /mnt}},通过 {{ic|df -h}} 确认根文件目录包含足够的空间<br />
# 同样挂载 proc, sys 和 dev 文件系统:{{ic|mount -t proc proc /mnt/proc; mount --rbind /sys /mnt/sys; mount --rbind /dev /mnt/dev}}<br />
# 如果系统使用默认的数据库目录位置,可以通过 root 用户执行下面命令{{ic|pacman --sysroot /mnt -Syu}}来更新系统的 ''pacman'' 数据库。<br />
# 更新之后,可以通过下面命令确认是否还存在损坏的包:{{ic|find /mnt/usr/lib -size 0}} <br />
# 通过{{ic|pacman --sysroot /mnt -S ''package''}}重新安装依然损坏的软件包<br />
<br />
=== 手动重新安装 pacman ===<br />
<br />
{{警告|这种方式极其容易破坏你的系统,把它变得更糟。这个方式只是作为最后的措施,以防万一[[#pacman 更新时崩溃]]不起作用}}<br />
<br />
即使 ''pacman'' 严重损坏,你仍可以手动修复它,这需要下载最新的包并把它们解压到正确的目录。大致步骤如下:<br />
<br />
# 确定要安装的{{pkg|pacman}}依赖项<br />
# 从你选择的[[mirror]]下载每个包<br />
# 把每个包解压到 root<br />
# 使用{{ic|pacman -S --overwrite}}重新安装这些包来更新相应的软件包数据库<br />
# 进行完整系统更新<br />
<br />
如果你拥有一个健康的 Arch 系统,你可以这样查看依赖项的完整列表:<br />
<br />
$ pacman -Q $(pactree -u pacman)<br />
<br />
但是依据你遇到的问题,你可能只需要更新其中的几个。解压一个包的示例是:<br />
<br />
# tar -xvpwf ''package.tar.xz'' -C / --exclude .PKGINFO --exclude .INSTALL --exclude .MTREE --exclude .BUILDINFO<br />
<br />
注意{{ic|w}}参数表示交互模式。以非交互方式运行是非常冒险的,因为你可能就此覆盖了一个重要文件。你也要注意以正确的顺序解压软件包(例如先解压依赖)。<br />
[https://bbs.archlinux.org/viewtopic.php?id=95007 这个帖子]包含了一些这个过程的例子,这些例子中只有少量''pacman''依赖项损坏。<br />
<br />
=== 升级系统重启后,出现"unable to find root device"错误,无法登陆 ===<br />
<br />
很有可能 [[initramfs]] 在[[kernel (简体中文)|内核]]升级时损坏(例如由错误地使用 ''pacman'' 的 {{ic|--overwrite}} 选项导致)。有两个选择;首先尝试 ''Fallback''启动项。<br />
<br />
{{小贴士|万一你删除了 ''Fallback'' 启动项,你总可以在启动加载器菜单显示出来的时候按{{ic|Tab}}键(对于 Syslinux)或者按{{ic|e}}键(对于 GRUB 或者 systemd-boot),将它重命名为{{ic|initramfs-linux-fallback.img}}然后按{{ic|Enter}}或者{{ic|b}}(取决于你的[[启动加载器]]以新参数启动的方式)}}<br />
<br />
一旦系统启动,从控制台或终端(为备用{{Pkg|linux}}内核)运行这条命令来重建 initramfs 映像:<br />
<br />
# mkinitcpio -p linux<br />
<br />
如果上面方法不行,从一个当前的 Arch 发行(CD/DVD 或者 U盘),[[挂载]]你的根目录和启动分区,然后用 ''arch-chroot'' [[chroot]]<br />
<br />
# arch-chroot /mnt<br />
# pacman -Syu mkinitcpio systemd linux<br />
<br />
{{注意|<br />
* 如果你没有一个当前的发行或者你只有某些其他的 "live" Linux 发行版,你可以用老式的方法[[chroot]]。显然,这种方式比简单地运行{{ic|arch-chroot}}脚本需要更多的输入<br />
* 如果 ''pacman'' 伴随{{ic|Could not resolve host}}运行失败,请[[Network_configuration_(简体中文)#检查连接|检查你的网络连接]]<br />
* 如果无法进入 arch-chroot 或 chroot 环境,但是需要重新安装软件包,可以使用 {{ic|pacman --sysroot /mnt -Syu foo bar}} 从而在你的根分区下使用 ''pacman'' }}<br />
<br />
重新安装内核({{Pkg|linux}} 软件包)将会自动运行 {{ic|mkinitcpio -p linux}} 重新生成 initramfs 镜像,不需要单独生成。<br />
<br />
之后建议执行 {{ic|exit}}, {{ic|umount /mnt/{boot,} }} 然后 {{ic|reboot}}.<br />
<br />
=== Signature from "User <email@gmail.com>" is unknown trust, installation failed ===<br />
<br />
试试以下途径:<br />
* 更新已知密钥:{{ic|pacman-key --refresh-keys}};<br />
* 手动升级{{ic|archlinux-keyring}}软件包:{{ic|pacman -Sy archlinux-keyring && pacman -Su}}.<br />
* 查看[[pacman-key#Resetting all the keys]].<br />
<br />
=== 请求导入 PGP keys ===<br />
<br />
如果用过时的 ISO [[Installation_guide_(简体中文)|安装]] Arch,你很有可能被提示要导入 PGP keys。同意下载密钥来继续。如果你无法成功添加 PGP keys,更新或升级 keyring {{Pkg|archlinux-keyring}} (浏览 [[#Signature from "User <email@gmail.com>" is unknown trust, installation failed|above]]).<br />
<br />
=== Error: key "0123456789ABCDEF" could not be looked up remotely ===<br />
<br />
If packages are signed with new keys, which were only recently added to {{Pkg|archlinux-keyring}}, these keys are not locally available during update (chicken-egg-problem). The installed {{Pkg|archlinux-keyring}} does not contain the key, until it is updated. Pacman tries to bypass this by a lookup through a key-server, which might not be possible e.g. behind proxys or firewalls and results in the stated error. Upgrade {{Pkg|archlinux-keyring}} first as shown [[#Signature from "User <email@example.org>" is unknown trust, installation failed|above]].<br />
<br />
=== 不停看到错误 "PackageName: signature from "User <email@archlinux.org>" is invalid" ===<br />
<br />
当系统时间错误时,签名密钥将会被认为过期(或无效)并且签名检查将会失败,提示以下错误信息:<br />
<br />
error: PackageName: signature from "User <email@archlinux.org>" is invalid<br />
error: failed to commit transaction (invalid or corrupted package (PGP signature))<br />
Errors occured, no packages were upgraded. <br />
<br />
确保矫正[[System_time_(简体中文)|系统时间]],例如在安装或升级前从 root 执行 {{ic|ntpd -qg}} ,和 {{ic|hwclock -w}}。<br />
<br />
=== 'warning: current locale is invalid; using default "C" locale' 错误 ===<br />
<br />
错误信息已经很明确了,locale 设置不正确,请阅读[[Locale]]进行设置。<br />
<br />
=== Pacman 不使用我的代理设置 ===<br />
<br />
正确设置环境变量({{ic|$http_proxy}}, {{ic|$ftp_proxy}} 等)如果使用 [[sudo]],需要让 sudo [[sudo#Environment variables|将这些变量传递给 pacman]].<br />
<br />
=== 如何重装所有包并保留安装和依赖信息? ===<br />
重装所有软件包:{{ic|pacman -S $(pacman -Qnq)}}({{ic|-S}} 选项会保留安装缘由)。<br />
<br />
接着需要重装外来包(不在官方仓库里的软件包)。外来包可通过{{ic|pacman -Qmq}}查看。<br />
<br />
=== "Cannot open shared object file" 错误 ===<br />
<br />
有可能是前一次 ''pacman'' 事务中删除或者损坏了 pacman 自身需要的一些共享库。<br />
<br />
要修复这种情况,你需要手动解压那些共享库文件到文件系统中合适的地方。首先请查明哪个包中包含有所需的库文件,然后在 ''pacman'' 缓存中 ({{ic|/var/cache/pacman/pkg/}}) 找到对应的包。解压出需要的库文件到文件系统的对应位置,如此可以继续使用 ''pacman'' 。<br />
<br />
之后需要重新安装损坏的软件包。注意你可能需要使用 {{ic|--overwrite}} 选项覆盖掉你刚刚解压出的系统文件,因为 ''pacman'' 可能没有跟踪到对应的文件信息。 ''pacman'' 随后会使用包中的文件正确替换掉共享库文件。如此能修好您的 pacman ,然后请继续更新系统中剩下的软件包。<br />
<br />
=== 软件包下载停滞 ===<br />
<br />
Some issues have been reported regarding network problems that prevent ''pacman'' from updating/synchronizing repositories. [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] [https://bbs.archlinux.org/viewtopic.php?id&#61;65728] When installing Arch Linux natively, these issues have been resolved by replacing the default ''pacman'' file downloader with an alternative (see [[Improve pacman performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using ''Host interface'' instead of ''NAT'' in the machine properties.<br />
<br />
=== 无法从镜像服务器获取 'core.db' ===<br />
<br />
如果从正确的[[mirrors|镜像服务器]]收到此错误,请换一个[[Resolv.conf|域名解析服务器]]。<br />
<br />
=== error: 'local-package.pkg.tar': permission denied ===<br />
<br />
如果你想要在一个 sshfs 上使用{{ic|pacman -U}}安装软件包并遇到了这个错误,将包移动到本地目录,再试一次。<br />
<br />
== 另请参见 ==<br />
<br />
* [https://www.archlinux.org/pacman/ Pacman Home Page]<br />
* {{man|3|libalpm}}<br />
* {{man|8|pacman}}<br />
* {{man|5|pacman.conf}}<br />
* {{man|8|repo-add}}</div>Cjc7373https://wiki.archlinux.org/index.php?title=User:Cjc7373&diff=620725User:Cjc73732020-06-18T06:48:11Z<p>Cjc7373: Created page with "Hi. ~~~~"</p>
<hr />
<div>Hi.<br />
[[User:Cjc7373|Cjc7373]] ([[User talk:Cjc7373|talk]]) 06:48, 18 June 2020 (UTC)</div>Cjc7373https://wiki.archlinux.org/index.php?title=User_talk:Cjc7373&diff=620724User talk:Cjc73732020-06-18T06:47:55Z<p>Cjc7373: Created page with "Hi. ~~~~"</p>
<hr />
<div>Hi. [[User:Cjc7373|Cjc7373]] ([[User talk:Cjc7373|talk]]) 06:47, 18 June 2020 (UTC)</div>Cjc7373https://wiki.archlinux.org/index.php?title=Pacman_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=619469Pacman (简体中文)2020-06-12T07:02:05Z<p>Cjc7373: /* 查询包数据库 */ -Ss 修正错误</p>
<hr />
<div>{{Lowercase title}}<br />
[[Category:Package management (简体中文)]]<br />
[[ar:Pacman]]<br />
[[cs:Pacman]]<br />
[[da:Pacman]]<br />
[[de:Pacman]]<br />
[[el:Pacman]]<br />
[[en:Pacman]]<br />
[[es:Pacman]]<br />
[[fa:Pacman]]<br />
[[fr:Pacman]]<br />
[[id:Pacman]]<br />
[[it:Pacman]]<br />
[[ja:Pacman]]<br />
[[ko:Pacman]]<br />
[[nl:Pacman]]<br />
[[pl:Pacman]]<br />
[[pt:Pacman]]<br />
[[ru:Pacman]]<br />
[[sr:Pacman]]<br />
[[sv:Pacman]]<br />
[[zh-hant:Pacman]]<br />
{{Related articles start (简体中文)}}<br />
{{Related|Creating packages (简体中文)}}<br />
{{Related|软件包降级}}<br />
{{Related|pacman/Package signing (简体中文)}}<br />
{{Related|pacman/Pacnew and Pacsave (简体中文)}}<br />
{{Related|pacman/Rosetta (简体中文)}}<br />
{{Related|pacman/Tips and tricks (简体中文)}}<br />
{{Related|FAQ (简体中文)}}<br />
{{Related|System maintenance (简体中文)}}<br />
{{Related|Arch Build System (简体中文)}}<br />
{{Related|Official repositories (简体中文)}}<br />
{{Related|Arch User Repository (简体中文)}}<br />
{{Related articles end}}<br />
{{TranslationStatus (简体中文)|pacman|2017-10-16|490231}}<br />
[https://archlinux.org/pacman/ pacman][[Wikipedia:Package management system|软件包管理器]]是 Arch Linux 的一大亮点。它将一个简单的二进制包格式和易用的构建系统结合了起来(参见[[makepkg]]和[[ABS]])。不管软件包是来自官方的 Arch 库还是用户自己创建,''pacman'' 都能方便地管理。<br />
<br />
''pacman'' 通过和主服务器同步软件包列表来进行系统更新。这种服务器/客户端模式可以使用一条命令就下载或安装软件包,同时安装必需的依赖包。<br />
<br />
''pacman'' 用 C 语言编写,使用[[w:tar (computing)|tar]]打包格式。<br />
<br />
{{小贴士|{{Pkg|pacman}} 软件包还提供了其它有用工具,例如 [[makepkg]]、'''pactree'''、'''vercomp'''、 [[checkupdates]]等。可以通过 {{Ic|pacman -Ql pacman <nowiki>|</nowiki> grep bin}} 获取工具列表。}}<br />
<br />
==用法==<br />
<br />
下面只是一个可执行操作的小部分示范,''pacman'' 的其他示例请阅读{{man|8|pacman}}。<br />
<br />
{{小贴士|使用过其它发行版的用户,可以参考 [[Pacman Rosetta]] 中的对比.}}<br />
<br />
===安装软件包===<br />
<br />
{{注意|软件包通常有很多[[PKGBUILD#optdepends|可选依赖]], 它们为软件提供额外功能, 并不强制要求安装它们。 安装软件时, ''pacman'' 将会输出它的可选依赖, 但是这个输出不会在 {{ic|pacman.log}}中;当你想浏览已安装软件的可选依赖时可以使用{{ic|pacman -Si}} ,得到关于可选依赖的简短描述。}}<br />
<br />
{{警告|1=在Arch下安装软件包时,未[[#升级软件包|更新]]系统前,'''不要'''更新软件包数据库(例如,可能出现某软件包不再出现在官方库)。操作时,应使用{{ic|pacman -Syu ''package_name''}}, 而不要使用({{ic|pacman -Sy ''package_name''}}),否则可能会有依赖问题。参见 [[System maintenance (简体中文)#不支持部分升级]] 和 [https://bbs.archlinux.org/viewtopic.php?id=89328 BBS#89328].}}<br />
<br />
====安装指定的包====<br />
安装或者升级单个软件包,或者一列软件包(包含依赖包),使用如下命令:<br />
<br />
# pacman -S package_name1 package_name2 ...<br />
<br />
用正则表达式安装多个软件包(参见 [[pacman tips (简体中文)#巧用 Bash 语法|pacman 小贴士]]{{Broken section link}}和[https://bbs.archlinux.org/viewtopic.php?id=7179 这个帖子]):<br />
<br />
# pacman -S $(pacman -Ssq package_regex)<br />
<br />
有时候在不同的软件仓库中,一个软件包有多个版本(比如[extra]和[testing])。可以选择一个来安装:<br />
<br />
# pacman -S extra/package_name<br />
<br />
安装多个含有相似名称的软件包,而并非整个包组或全部匹配的软件包; 例如,{{Grp|plasma}}:<br />
<br />
# pacman -S plasma-{desktop,mediacenter,nm}<br />
<br />
当然,可以多层扩展,并不作限制:<br />
<br />
# pacman -S plasma-{workspace{,-wallpapers},pa}<br />
<br />
====安装包组====<br />
<br />
一些包属于一个可以同时安装的[[Creating_packages#Meta_packages_and_groups|软件包组]]{{Broken section link}}。例如,运行下面的命令<br />
<br />
# pacman -S gnome<br />
<br />
会提醒用户选择 {{ic|gnome}} 内需要安装的包。<br />
<br />
有的包组包含大量的软件包,有时用户只需其中几个。除了逐一键入序号外,pacman 还支持选择或排除某个区间内的的软件包:<br />
<br />
Enter a selection (default=all): 1-10 15<br />
<br />
这将选中序号 1 至 10 和 15 的软件包。而<br />
<br />
Enter a selection (default=all): ^5-8 ^2<br />
<br />
将会选中除了序号 5 至 8 和 2 之外的所有软件包。<br />
<br />
想要查看哪些包属于 gnome 组,运行:<br />
<br />
# pacman -Sg gnome<br />
<br />
也可以访问 https://www.archlinux.org/groups/ 查看可用的包组。<br />
<br />
{{注意|如果列表中的包已经安装在系统中,它会被重新安装,即使它已经是最新的。可以用 {{ic|--needed}} 选项覆盖这种行为。}}<br />
<br />
===删除软件包===<br />
<br />
删除单个软件包,保留其全部已经安装的依赖关系<br />
<br />
pacman -R package_name<br />
<br />
删除指定软件包,及其所有没有被其他已安装软件包使用的依赖关系:<br />
<br />
pacman -Rs package_name<br />
<br />
要删除软件包和所有依赖这个软件包的程序:<br />
<br />
{{警告|此操作是递归的,请小心检查,可能会一次删除大量的软件包。}}<br />
<br />
# pacman -Rsc package_name<br />
<br />
要删除一个被其他软件包依赖的软件包,但是不删除依赖这个软件包的其他软件包:<br />
<br />
{{警告|此操作有破坏系统的能力,应该尽量避免使用。详情请看 [[System maintenance#Avoid certain pacman commands|避免某些 Pacman 命令]]。}}<br />
<br />
# pacman -Rdd package_name<br />
<br />
''pacman'' 删除某些程序时会备份重要配置文件,在其后面加上*.pacsave扩展名。-n 选项可以避免备份这些文件:<br />
<br />
pacman -Rn package_name<br />
<br />
{{注意|''pacman'' 不会删除软件自己创建的文件(例如主目录中的 {{ic|.dot}} 文件不会被删除。}}<br />
<br />
=== 升级软件包 ===<br />
{{警告|* 建议所有用户都 [[System_maintenance#Upgrading the system|经常性的更新系统]]。<br />
* Arch 只支持系统完整升级,详细参见[[System maintenance#Partial upgrades are unsupported|不支持部分升级]]和[[#安装软件包]]。}}<br />
<br />
一个 ''pacman'' 命令就可以升级整个系统。花费的时间取决于系统有多老。这个命令会同步非本地(local)软件仓库并升级系统的软件包:<br />
<br />
# pacman -Syu<br />
<br />
===查询包数据库===<br />
<br />
''pacman'' 使用 {{ic|-Q}} 参数查询本地软件包数据库。参见:<br />
<br />
$ pacman -Q --help<br />
<br />
使用 {{ic|-S}} 参数来查询远程同步的数据库。参见:<br />
<br />
$ pacman -S --help<br />
<br />
''pacman'' 可以在包数据库中查询软件包,查询位置包含了软件包的名字和描述:<br />
<br />
$ pacman -Ss ''string1'' ''string2'' ...<br />
<br />
有时,{{Ic|-s}}的内置正则会匹配很多不需要的结果,所以应当指定仅搜索包名,而非描述或其他子段:<br />
<br />
$ pacman -Ss '^vim-'<br />
<br />
要查询已安装的软件包:<br />
<br />
$ pacman -Qs ''string1'' ''string2'' ...<br />
<br />
按文件名查找软件库:<br />
<br />
$ pacman -F ''string1'' ''string2'' ...<br />
<br />
显示软件包的详尽的信息:<br />
<br />
$ pacman -Si ''package_name''<br />
<br />
查询本地安装包的详细信息:<br />
<br />
$ pacman -Qi ''package_name''<br />
<br />
使用两个 {{ic|-i}} 将同时显示备份文件和修改状态:<br />
<br />
$ pacman -Qii ''package_name''<br />
<br />
要获取已安装软件包所包含文件的列表:<br />
<br />
$ pacman -Ql ''package_name''<br />
<br />
查询远程库中软件包包含的文件:<br />
<br />
$ pacman -Fl ''package_name''<br />
<br />
检查软件包安装的文件是否都存在:<br />
<br />
$ pacman -Qk ''package_name''<br />
<br />
两个参数{{ic|k}}将会执行一次更彻底的检查。<br />
查询数据库获取某个文件属于哪个软件包:<br />
<br />
$ pacman -Qo ''/path/to/file_name''<br />
<br />
查询文件属于远程数据库中的哪个软件包:<br />
<br />
$ pacman -F ''/path/to/file_name''<br />
<br />
要罗列所有不再作为依赖的软件包(孤立orphans):<br />
<br />
$ pacman -Qdt<br />
<br />
要罗列所有明确安装而且不被其它包依赖的软件包:<br />
<br />
$ pacman -Qet<br />
<br />
要显示软件包的依赖树:<br />
<br />
$ pactree ''package_name''<br />
<br />
检查一个''安装''的软件包被那些包依赖,可以使用 {{AUR|pkgtools}}中的''whoneeds'':<br />
<br />
$ whoneeds ''package_name''<br />
<br />
或者''pactree''中使用{{ic|-r}}:<br />
<br />
$ pactree -r ''package_name''<br />
<br />
更多信息查看[[pacman tips]]。<br />
<br />
==== 数据库结构 ====<br />
<br />
pacman数据库通常位于 {{ic|/var/lib/pacman/sync}}. 对于每一个在{{ic|/etc/pacman.conf}}中指定的软件仓库, 这里都有一个一致的数据库。数据库文件夹里每个tar.gz文件都包含着一个仓库的软件包信息。例如{{Pkg|which}} 包:<br />
<br />
{{bc|<br />
% tree which-2.20-6 <br />
which-2.20-6<nowiki><br />
|-- depends<br />
`-- desc</nowiki><br />
}}<br />
<br />
这个 {{ic|depends}} 项列出了该软件的依赖包, 而{{ic|desc}}有该包的介绍,例如文件大小和MD5值 。<br />
<br />
=== 清理软件包缓存 ===<br />
<br />
''pacman'' 将下载的软件包保存在 {{ic|/var/cache/pacman/pkg/}} 并且不会自动移除旧的和未安装版本的软件包,因此需要手动清理,以免该文件夹过于庞大。<br />
<br />
使用内建选项即可清除未安装软件包的缓存:<br />
<br />
# pacman -Sc<br />
<br />
{{警告|<br />
* 仅在确定当前安装的软件包足够稳定且不需要[[Downgrading packages (简体中文)|降级]]时才执行清理。{{ic|pacman -Sc}}仅会保留软件包的当前有效版本,旧版本的软件包被清理后,只能从其他地方如 [[Arch Linux Archive (简体中文)]]中获取了。<br />
* {{ic|pacman -Scc}} 可以清理所有缓存,但这样 pacman 在重装软件包时就只能重新下载了。除非空间不足,否则不应这么做。<br />
}}<br />
<br />
由于以上种种局限,建议使用专门的脚本去处理清理哪些、清理多少缓存:<br />
<br />
{{Pkg|pacman-contrib}} 提供的 ''paccache'' 命令默认会删除近3个版本前的软件包<br />
<br />
# paccache -r<br />
<br />
{{Tip|1=可以使用 [[pacman hooks]] 自动执行清理,[https://bbs.archlinux.org/viewtopic.php?pid=1694743#p1694743 这里]是参考示例。}}<br />
<br />
也可以自己设置保留最近几个版本:<br />
<br />
# paccache -rk 1<br />
<br />
清理所有未安装包的缓存文件,再此运行{{ic|paccache}}:<br />
<br />
# paccache -ruk0<br />
<br />
更多功能参见{{ic|paccache -h}}。<br />
<br />
''paccache'',还可以使用 [[Arch User Repository (简体中文)|Arch User Repository]] 中的 {{AUR|pkgcacheclean}}:{{bc|# pkgcacheclean}},以及{{AUR|pacleaner}},这两个是未来的替代工具.<br />
<br />
===其它命令===<br />
<br />
升级系统时安装其他软件包:<br />
<br />
# pacman -Syu ''package_name1'' ''package_name2'' ...<br />
<br />
下载包而不安装它:<br />
# pacman -Sw package_name<br />
<br />
安装一个'''本地'''包(不从源里下载):<br />
# pacman -U /path/to/package/package_name-version.pkg.tar.xz<br />
<br />
要将本地包保存至缓存,可执行:<br />
# pacman -U file://path/to/package/package_name-version.pkg.tar.xz<br />
<br />
安装一个'''远程'''包(不在 ''pacman'' 配置的源里面):<br />
# pacman -U <nowiki>http://www.example.com/repo/example.pkg.tar.xz</nowiki><br />
<br />
要禁用 {{ic|-S}}, {{ic|-U}} 和 {{ic|-R}} 动作,可以使用 {{ic|-p}} 选项.<br />
<br />
''pacman'' 会列出需要安装和删除的软件,并在执行动作前要求需要的权限。<br />
<br />
===安装原因===<br />
''pacman''数据库按照软件包被安装的原因,将其分为两类:<br />
<br />
* '''指定安装包''':通过''pacman''{{ic|-S}}或者{{ic|-U}}指令安装的软件包。<br />
* '''依赖包''':指定安装包所依赖的软件包,尽管命令中未传入,但仍然会被安装。<br />
<br />
当安装软件包时,可以把安装原因指定设为'''依赖''':<br />
<br />
# pacman -S --asdeps package_name<br />
<br />
但是当重新安装该软件包时,安装原因将会被设为软件包所默认的。<br />
指定安装的软件包列表可用{{ic|pacman -Qe}}, 已安装的依赖包可用{{ic|pacman -Qd}}获取。<br />
改变某个已安装软件包的安装原因,可以执行:<br />
<br />
# pacman -D --asdeps package_name<br />
<br />
使用{{ic|--asexplicit}}改为'''指定安装'''。<br />
<br />
=== 查询一个包含具体文件的包名 ===<br />
<br />
同步文件数据库:<br />
<br />
# pacman -Fy<br />
<br />
查询包含某个文件的包名,比如:<br />
<br />
# pacman -F pacman<br />
core/pacman 5.0.1-4<br />
usr/bin/pacman<br />
usr/share/bash-completion/completions/pacman<br />
extra/xscreensaver 5.36-1<br />
usr/lib/xscreensaver/pacman<br />
<br />
{{小贴士 | 可以设置一个 {{ic|crontab}} 或者 {{ic|systemd timer}} 来定期同步文件信息数据库。}}<br />
<br />
如果需要高级功能请安装 [[pkgfile]],它使用一个单独的数据库来保存文件和它们所关联的软件包的信息。<br />
<br />
==配置==<br />
''pacman'' 的配置文件位于{{ic|/etc/pacman.conf}}。 [https://www.archlinux.org/pacman/pacman.conf.5.html man pacman.conf] 可以查看配置文件的进一步信息。<br />
<br />
===通用选项===<br />
<br />
通用选项都在{{Ic|[options]}}段。阅读 man 手册或者查看默认的 pacman.conf 可以获得有关信息和用法。<br />
<br />
===升级前对比版本===<br />
要查看旧版和新版的有效安装包,请取消{{ic|/etc/pacman.conf}}中"VerbosePkgLists"的注释。修改后的{{ic|pacman -Syu}}输出如下:<br />
<br />
Package (6) Old Version New Version Net Change Download Size<br />
<br />
extra/libmariadbclient 10.1.9-4 10.1.10-1 0.03 MiB 4.35 MiB<br />
extra/libpng 1.6.19-1 1.6.20-1 0.00 MiB 0.23 MiB<br />
extra/mariadb 10.1.9-4 10.1.10-1 0.26 MiB 13.80 MiB<br />
<br />
==== 彩色输出 ====<br />
Pacman 具有颜色选项,取消 "Color" 行的注释即可.<br />
<br />
====不升级软件包====<br />
<br />
如果由于某种原因,用户不希望升级某个软件包,可以加入内容如下:<br />
IgnorePkg = 软件包名<br />
<br />
多软件包可以用空格隔开,也可是用 glob 模式。如果只打算忽略一次升级,可以使用 {{ic|--ignore}} 选项。<br />
<br />
忽略了的软件包可通过 {{ic|pacman -S}} 升级。<br />
<br />
====不升级软件包组====<br />
<br />
和软件包一样,也可以不升级某个软件包组:<br />
IgnoreGroup = gnome<br />
<br />
==== 跳过软件包文件 ====<br />
<br />
{{Warning|跳过软件包时请考虑清楚,Arch 官方并不支持 [[partial upgrades|部分更新]]。}}<br />
<br />
要跳过某些文件夹的安装,可以将它们放到 {{Ic|NoExtract}} 中,例如不想安装 [[systemd]] unit 文件:<br />
<br />
NoExtract=usr/lib/systemd/system/*<br />
<br />
后面的规则覆盖前面的规则,加上 {{ic|!}} 可以取消跳过效果.<br />
<br />
===保留多个配置文件===<br />
<br />
如果你有多个配置文件(比如,主配置和测试''testing''仓库生效的配置文件),需要共享一些设置:<br />
<br />
Include = /path/to/common/settings<br />
<br />
{{ic|/path/to/common/settings}}文件中是两个配置文件共享的相同配置。<br />
<br />
===Hooks===<br />
'''pacman'''可以在更新安装前后时,运行{{ic|/usr/share/libalpm/hooks/}}文件夹下的hooks,更多的hooks文件夹{{ic|HooDir}}可以在{{ic|pacman.conf}}中设置,默认{{ic|/etc/pacman.d/hooks}}。Hook文件必须以'''.hook'''结尾。<br />
<br />
===软件仓库===<br />
除了特殊的[[#General options|options]]{{Broken section link}}section, 每个{{ic|pacman.conf}}中的{{ic|section}}都定义了一个使用的软件包仓库,''仓库''是多个软件包的''逻辑''上的集合,他们''物理''上存储在一个或多个服务器:这也是为什么每一个服务器都叫做这个仓库的''镜像''。<br />
<br />
仓库区分为[[Official repositories|官方]与[Unofficial user repositories|非官方]]两类。配置文件中仓库的顺序十分重要;当几个仓库出现同名安装包,不管版本号是否相同,'''pacman'''将使用配置文件中排前的仓库。[[#Upgrading packages|upgrade]]{{Broken section link}}升级整个系统,来让新添加的仓库生效。<br />
<br />
每个仓库设置都可以直接指定镜像列表或者{{ic|Include}}引用其他的文件:例如,官方镜像引用了{{ic|/etc/pacman.d/mirrorlist/}}。具体查看[[Mirrors]]。<br />
<br />
=== 软件包的安全性 ===<br />
<br />
''pacman'' 4 支持软件包签名。语句 {{ic|1=SigLevel = Required DatabaseOptional}} 将启用全局签名验证,但会被每个软件仓库的 {{ic|SigLevel}} 行所覆盖。详情参见 [[pacman-key (简体中文)|pacman-key]].<br />
<br />
=== 一般注意事项 ===<br />
{{警告|小心使用 {{ic|--overwrite}} 选项。使用不当会造成大问题。 请''只''在 Arch 新闻里要求这么做的时候才用。}}<br />
<br />
''pacman'' 附带了许多实用工具能让系统使用更加便捷。所有工具功能都能通过 {{ic|--help}} 开关查看。运行:<br />
$ pacman -Ql pacman | awk -F"[/ ]" '/\/usr\/bin/ {print $5}'<br />
查看完整列表<br />
<br />
== 问题解决 ==<br />
<br />
=== 升级时遇到问题: "file exists in filesystem"(conflicting files)! ===<br />
<br />
如果碰到[https://bbs.archlinux.org/viewtopic.php?id=56373 这个帖子]的错误:<br />
<br />
error: could not prepare transaction<br />
error: failed to commit transaction (conflicting files)<br />
package: /path/to/file exists in filesystem<br />
Errors occurred, no packages were upgraded.<br />
<br />
发生了什么事: ''pacman'' 检测到文件冲突,而且按照设计,''pacman'' 不会覆盖文件。这是设计功能,不是缺陷。<br />
<br />
先用 ({{Ic|pacman -Qo 文件的完整路径}} 检查哪个软件包提供了文件。如果是其它软件包,请[[Reporting bug guidelines|报告问题]]。如果不是其它软件包提供,将已经存在的文件重命名并重新升级。如果一切顺利,可以删掉备份文件。<br />
<br />
如果是通过 {{Ic|make install}} 等非 pacman 方式安装的软件,安装的文件不属于任何软件包!需要先手动删除这些文件,这样就可以正常安装软件了。[[pacman tips#Identify_files_not_owned_by_any_package|不属于任何软件包的文件列表]]一文中提供了查找这些文件的脚本。<br />
<br />
每一个安装的软件包都会提供一个 {{ic|/var/lib/pacman/local/''$package-$version''/files}} 文件,包含此软件包的元数据。如果文件损坏或者丢失,将会导致升级时出现{{ic|file exists in filesystem}} 错误。此错误通常只会影响一个软件包,除了手动删除或移动所有的问题文件,可以作为特例使用{{ic|pacman -S $package --overwrite /path/to/file }}让 ''pacman'' 强制覆盖这些文件。<br />
<br />
{{警告|{{ic|--overwrite}} 选项非常危险,建议在 Arch 新闻中明确通知的时候才使用它,否则可能导致系统无法启动。一些老旧博客论坛可能提到 --force 选项,现在 pacman 已经不再支持,以 --overwrite 取代。}}<br />
<br />
=== "failed to commit transaction (invalid or corrupted package" 错误 ===<br />
<br />
看看{{Ic|/var/cache/pacman/pkg}}中是否有{{Ic|*.part}}结尾的文件,它们是没有完全下载的文件,删除它们并重新执行更新。这些程序一般是自定义的{{Ic|XferCommand}} 下载命令造成的。<br />
<br />
# find /var/cache/pacman/pkg/ -iname "*.part" -exec rm {} \;<br />
<br />
=== "error: failed to init transaction (unable to lock database)" 错误 ===<br />
<br />
''pacman'' 在更新软件包数据库前,比如安装软件包时会创建一个文件锁 {{ic|/var/lib/pacman/db.lck}}。该文件会阻止其他 ''pacman'' 实例在同一时间修改软件包数据库。如果 ''pacman'' 在更新数据库时收到干扰,旧锁会一直存在。如果确认 ''pacman'' 没有在运行,那么删掉文件锁:<br />
<br />
# rm /var/lib/pacman/db.lck<br />
<br />
=== 安装时无法获取软件包 ===<br />
<br />
错误内容包含:{{ic|Not found in sync db}}, {{ic|Target not found}} 或 {{ic|Failed retrieving file}}.<br />
<br />
首先确认软件包确实存在(并注意错别字)。如果确认软件包存在,可能本地数据库过时了或者软件仓库没有配置好,试试 {{ic|pacman -Syyu}} 强制数据库更新和升级。<br />
<br />
也有可能包含该软件包的软件仓库没有启动。例如,该软件包可能在 ''multilib'' 仓库里,但该仓库没有在 ''pacman.conf'' 中启用。<br />
<br />
参阅[[FAQ#Why is there only a single version of each shared library in the official repositories?]].<br />
<br />
=== pacman 重复升级同一个包 ===<br />
{{注意|''pacman'' 版本 3.4 在遇到重复条目时会显示错误,因此这个问题过时了。}}<br />
<br />
这是因为在 {{ic|/var/lib/pacman/local/}} 有重复的条目,例如有两个 {{ic|linux}} 条目。{{ic|pacman -Qi}} 输出正确的版本,但是 {{ic|pacman -Qu}} 识别了旧版本,因此尝试升级。<br />
<br />
解决方法:删除 {{ic|/var/lib/pacman/local/}} 中多余的条目。<br />
<br />
=== pacman 完全坏掉,如何修复? ===<br />
<br />
如果 ''pacman'' 完全坏掉不能使用,需要手动下载或构建需要的软件包({{Pkg|openssl}}, {{Pkg|libarchive}} 和 {{Pkg|pacman}}) 并解压到根目录。''pacman'' 会和默认配置文件一起恢复。之后,用 ''pacman'' 重新安装这些软件包以保证数据库的完整性。<br />
<br />
=== pacman 更新时崩溃 ===<br />
<br />
如果 ''pacman'' 在删除、重新安装或更新软件包时 "数据库写入" 出错:<br />
# 从 Arch 安装媒体启动,最好用最新的安装媒体<br />
# 挂载根文件系统,通过 {{ic|df -h}} 确认根文件目录包含足够的空间<br />
# 如果系统使用默认的数据库目录位置,可以通过root用户执行下面命令{{ic|1=pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Syyu}}<br />
# 更新之后,可以通过下面命令确认是否还存在损坏的包:{{ic|find /mnt/usr/lib -size 0}} <br />
# 通过下面命令重新安装依然损坏的软件包:{{ic|1=pacman --root /mnt --cachedir=/mnt/var/cache/pacman/pkg -S ''package''}}.<br />
<br />
=== pacman crashes the official installation media ===<br />
<br />
The official installation media (ISO) before version 10.2015 are not setup to be updated itself at runtime. Running {{ic|pacman -Syu}} from a booted install media console may crash unexpectedly any time, as soon as memory is depleted. This happens because the install media image build reports an arbitrary capacity (of 32GB) to pacman, regardless of available free memory.[https://bugs.archlinux.org/task/45618#comment137346] At the same time the ISO reserves only a low static memory allotment for operations ({{ic|/run/archiso/cowspace}} of {{ic|256MB}} RAM) of the live system, in order to allow installation on machines with low resources. If the machine has more RAM available, you can override the allotment by setting the {{ic|1=cow_spacesize=}} kernel option for the ISO manually, e.g. {{ic|1=cow_spacesize=2GB}}. <br />
<br />
If you use the install media to update an installed system, you simply have to use the {{ic|1=--root=}} option along with a {{ic|1=--cachedir=}} path to point pacman to available real storage. For example, see [[#pacman 更新时崩溃]]. <br />
<br />
If you ''require'' an install media with persistent dataspace, the [[Archiso]] build script can be used to create one along with its [https://projects.archlinux.org/archiso.git/tree/docs/README.bootparams boot options].<br />
<br />
=== 升级系统重启后,出现"unable to find root device"错误,无法登陆 ===<br />
<br />
很有可能 initramfs 在内核升级时损坏,例如错误的使用 ''pacman'' 的 {{ic|--overwrite}} 选项。有两个选择:<br />
<br />
==== Fallback 启动项 ====<br />
<br />
{{小贴士|如果删除了此启动项,可以在启动时进入启动加载器的手动模式,将 initramfs 修改为 {{ic|initramfs-linux-fallback.img}} 继续启动。}}<br />
<br />
如果系统可以启动,运行如下命令可以生产原始内核 {{Pkg|linux}} 的 initramfs:<br />
<br />
{{bc|# mkinitcpio -p linux}}<br />
<br />
==== Chroot 修复 ====<br />
如果上面方法不行,请下载最新的安装程序进行启动,执行:<br />
<br />
{{bc|<nowiki><br />
# mount /dev/sdxY /mnt #Your root partition.<br />
# mount /dev/sdxZ /mnt/boot #If you use a separate /boot partition.<br />
# arch-chroot /mnt<br />
# pacman -Syu mkinitcpio systemd-tools linux</nowiki>}}<br />
<br />
重新安装内核({{Pkg|linux}} 软件包)将会自动运行 {{ic|mkinitcpio -p linux}} 重新生成 initramfs 镜像,不需要单独生成。<br />
<br />
之后建议执行 {{ic|exit}}, {{ic|umount /mnt/{boot,} }} 然后 {{ic|reboot}}.<br />
<br />
{{Note|如果无法进入 arch-chroot 或 chroot 环境,但是需要重新安装软件包,可以使用 pacman -r /mnt -Syu foo bar }}<br />
<br />
=== Signature from "User <email@gmail.com>" is unknown trust, installation failed ===<br />
<br />
试试以下途径:<br />
* 更新已知密钥:{{ic|pacman-key --refresh-keys}};<br />
* 手动升级{{ic|archlinux-keyring}}软件包:{{ic|pacman -Sy archlinux-keyring && pacman -Su}}.<br />
* 查看[[pacman-key#Resetting all the keys]].<br />
<br />
=== Request on importing PGP keys ===<br />
<br />
If [[Installation guide|installing]] Arch with an outdated ISO, you are likely prompted to import PGP keys. Agree to download the key to proceed. If you are unable to add the PGP key successfully, update the keyring or upgrade {{Pkg|archlinux-keyring}} (see [[#Signature from "User <email@gmail.com>" is unknown trust, installation failed|above]]).<br />
<br />
=== Error: key "0123456789ABCDEF" could not be looked up remotely ===<br />
<br />
If packages are signed with new keys, which were only recently added to {{Pkg|archlinux-keyring}}, these keys are not locally available during update (chicken-egg-problem). The installed {{Pkg|archlinux-keyring}} does not contain the key, until it is updated. Pacman tries to bypass this by a lookup through a key-server, which might not be possible e.g. behind proxys or firewalls and results in the stated error. Upgrade {{Pkg|archlinux-keyring}} first as shown [[#Signature from "User <email@example.org>" is unknown trust, installation failed|above]].<br />
<br />
=== 不停看到错误 "PackageName: signature from "User <email@archlinux.org>" is invalid" ===<br />
<br />
When the system time is faulty, signing keys are considered expired (or invalid) and signature checks on packages will fail with the following error:<br />
<br />
error: PackageName: signature from "User <email@archlinux.org>" is invalid<br />
error: failed to commit transaction (invalid or corrupted package (PGP signature))<br />
Errors occured, no packages were upgraded. <br />
<br />
Make sure to correct the [[system time]], for example with {{ic|ntpd -qg}} run as root, and run {{ic|hwclock -w}} as root before subsequent installations or upgrades.<br />
<br />
=== 'warning: current locale is invalid; using default "C" locale' 错误 ===<br />
<br />
错误信息已经很明确了,locale 设置不正确,请阅读[[Locale]]进行设置。<br />
<br />
=== pacman不使用我的代理设置 ===<br />
<br />
正确设置环境变量({{ic|$http_proxy}}, {{ic|$ftp_proxy}} etc.)如果使用[[sudo]],需要让 sudo [[sudo#Environment variables|将这些变量传递给 pacman]].<br />
<br />
=== 如何重装所有包并保留安装和依赖信息? ===<br />
重装所有软件包:{{ic|pacman -S $(pacman -Qnq)}}({{ic|-S}} 选项会保留安装缘由)。<br />
<br />
接着需要重装外来包(不在官方仓库里的软件包)。外来包可通过{{ic|pacman -Qmq}}查看。<br />
<br />
=== "Cannot open shared object file" 错误 ===<br />
<br />
有可能是前一次 ''pacman'' 事务中删除或者损坏了 pacman 自身需要的一些共享库。<br />
<br />
要修复这种情况,你需要手动解压那些共享库文件到文件系统中合适的地方。首先请查明哪个包中包含有所需的库文件,然后在 ''pacman'' 缓存中 ({{ic|/var/cache/pacman/pkg/}}) 找到对应的包。解压出需要的库文件到文件系统的对应位置,如此可以继续使用 ''pacman'' 。<br />
<br />
之后需要重新安装损坏的软件包。注意你可能需要使用 {{ic|--overwrite}} 选项覆盖掉你刚刚解压出的系统文件,因为 ''pacman'' 可能没有跟踪到对应的文件信息。 ''pacman'' 随后会使用包中的文件正确替换掉共享库文件。如此能修好您的 pacman ,然后请继续更新系统中剩下的软件包。<br />
<br />
=== 软件包下载停滞 ===<br />
<br />
Some issues have been reported regarding network problems that prevent ''pacman'' from updating/synchronizing repositories. [https://bbs.archlinux.org/viewtopic.php?id&#61;68944] [https://bbs.archlinux.org/viewtopic.php?id&#61;65728] When installing Arch Linux natively, these issues have been resolved by replacing the default ''pacman'' file downloader with an alternative (see [[Improve pacman performance]] for more details). When installing Arch Linux as a guest OS in [[VirtualBox]], this issue has also been addressed by using ''Host interface'' instead of ''NAT'' in the machine properties.<br />
<br />
=== 无法从镜像服务器获取 'core.db' ===<br />
<br />
如果从正确的[[mirrors|镜像服务器]]收到此错误,请换一个[[Resolv.conf|域名解析服务器]]。<br />
<br />
== 参见 ==<br />
* [https://www.archlinux.org/pacman/libalpm.3.html libalpm(3) Manual Page]<br />
* [https://www.archlinux.org/pacman/pacman.8.html pacman(8) Manual Page]<br />
* [https://www.archlinux.org/pacman/pacman.conf.5.html pacman.conf(5) Manual Page]<br />
* [https://www.archlinux.org/pacman/repo-add.8.html repo-add(8) Manual Page]</div>Cjc7373https://wiki.archlinux.org/index.php?title=NTFS-3G_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=584550NTFS-3G (简体中文)2019-10-06T16:23:51Z<p>Cjc7373: update translation</p>
<hr />
<div>[[Category:File systems (简体中文)]]<br />
[[en:NTFS-3G]]<br />
[[es:NTFS-3G]]<br />
[[he:NTFS-3G]]<br />
[[it:NTFS-3G]]<br />
[[ja:NTFS-3G]]<br />
[[ru:NTFS-3G]]<br />
[[zh-hant:NTFS-3G]]<br />
{{Related articles start}}<br />
{{Related|File systems}}<br />
{{Related articles end}}<br />
<br />
{{TranslationStatus (简体中文)|NTFS-3G|2019-10-06|573885}}<br />
Linux内核目前只支持对微软NTFS文件系统的读取。 [http://www.tuxera.com/community/ntfs-3g-download/ NTFS-3G] 是微软 NTFS 文件系统的一个开源实现,同时支持读和写。NTFS-3G 开发者使用 FUSE 文件系统来辅助开发,同时对可移植性有益。<br />
<br />
==安装==<br />
<br />
[[Install|安装]]位于[[Official repositories (简体中文)|官方软件仓库]]的软件包 {{Pkg|ntfs-3g}}。<br />
<br />
==手动挂载==<br />
你有两个选择。传统方法是:<br />
<br />
# mount /dev/''your_NTFS_partition'' ''/mount/point''<br />
<br />
挂载类型 {{ic|ntfs-3g}} 不需要显式指定。 {{ic|mount}} 命令默认会调用 {{ic|/usr/bin/mount.ntfs}} ,它在安装了 {{Pkg|ntfs-3g}} 之后被符号连接到 {{ic|/usr/bin/ntfs-3g}}。<br />
<br />
第二个选择是直接调用 {{ic|ntfs-3g}}:<br />
<br />
# ntfs-3g /dev/''your_NTFS_partition'' ''/mount/point''<br />
<br />
其他可用参数请查看{{man|8|ntfs-3g}}。<br />
<br />
==格式化==<br />
<br />
{{警告|和以前一样,再次检查设备路径。}}<br />
<br />
# mkfs.ntfs -Q -L diskLabel /dev/sd''XY''<br />
<br />
{{Note|{{ic|-Q}} 选项不向驱动器填充0且不检查坏扇区,以加快格式化速度。}}<br />
==配置==<br />
<br />
你的 NTFS 分区可以被配置成自动挂载,或者预先配置好来安装你想要的方式挂载。配置可以在文件系统配置文件 [[fstab]] 中指定或者使用 udev 规则。<br />
<br />
===默认配置===<br />
<br />
使用默认配置会在启动时挂载 NTFS 分区。使用这种方法,如果挂载位置的父文件夹有合适的用户或组[[Users and groups|权限]],用户或组就可以读写这个分区。<br />
<br />
把以下内容写入{{ic|/etc/fstab}}:<br />
<br />
# <file system> <dir> <type> <options> <dump> <pass><br />
/dev/''NTFS-part'' /mnt/windows ntfs-3g defaults 0 0<br />
<br />
===Linux权限兼容===<br />
<br />
Linux系统通常将目录的权限设为755,将文件的权限设为644。如果您经常使用NTFS分区,建议保留这些权限。下面的示例将上述权限分配给普通用户:<br />
<br />
# 安装具有 linux 兼容权限的内部 Windows 分区,即权限755用于目录(dmask=022)和权限644用于文件(fmask=133)<br />
/dev/''NTFS-partition'' /mnt/windows ntfs-3g uid=''username'',gid=users,dmask=022,fmask=133 0 0<br />
<br />
=== 允许组/用户 ===<br />
<br />
在{{ic|/etc/fstab}}中,您还可以指定其他选项,如允许访问(读取)分区的用户。例如,您允许{{ic|users}}组中的人员具有访问权限:<br />
<br />
/dev/''NTFS-partition'' /mnt/windows ntfs-3g gid=users,umask=0022 0 0<br />
<br />
默认情况下, 上述命令仅为root用户启用写支持。若要为其他用户启用,必须显示指定应授予写入权限的用户。使用{{ic|uid}}参数加您的用户名以启用用户写支持:<br />
<br />
/dev/''NTFS-partition'' /mnt/windows ntfs-3g uid=''username'',gid=users,umask=0022 0 0<br />
<br />
如果您在一个单用户计算机上运行,您可能希望自己拥有该文件系统并授予所有可能的权限:<br />
<br />
/dev/''NTFS-partition'' /mnt/windows ntfs-3g uid=''username'',gid=users 0 0<br />
<br />
===基本的 ntfs-3g 选项===<br />
<br />
对大多数人来说,上面的设置已经足够了。这是一些其他的对于不同的Linux文件系统的通用选项。完整列表参见[http://www.tuxera.com/community/ntfs-3g-manual/#6 这里]<br />
<br />
;[[umask]]: umask 是一个嵌入的 shell 命令,可以自动设置新创建的文件的权限。对于 Arch Linux,对于 root 和 user 默认的 umask 是 0022。设为 0022 将使新目录有目录权限755,新文件有权限644。你可以在[http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html 这里]查看更多关于 umask 权限的信息:。<br />
;noauto: 如果设置了 {{ic|noauto}},{{ic|/etc/fstab}} 中的 NTFS 条目不会在启动时自动挂载。<br />
;uid: 用户 id 号码。这允许指定用户具有完全的访问权限。你的uid可以用 {{ic|id}} 命令获得。<br />
;fmask and dmask: 与 {{ic|umask}} 类似但是分别定义的是文件和目录的权限。<br />
;windows_names: prevents files, directories and extended attributes to be created with a name not allowed by windows.<br />
<br />
===允许用户挂载===<br />
<br />
默认情况下,''ntfs-3g''需要 root 权限以装载文件系统, 即使在{{ic|/etc/fstab}}中有“user”选项。有关详细信息,请参阅 [http://www.tuxera.com/community/ntfs-3g-faq/#useroption ntfs-3g-faq]。仍然需要 fstab 中的用户选项。<br />
<br />
{{Note|<br />
* {{Pkg|ntfs-3g}}包没有内置FUSE支持。使用[[ABS]]重新构建包 或安装{{AUR|ntfs-3g-fuse}}。<br />
* 卸载权限似乎存在问题,因此如果需要卸载文件系统,则仍需要 root 权限。您还可以使用{{ic|fusermount -u /mnt/''mountpoint''}}来卸载文件系统并避免使用root权限。此外, 如果在{{ic|/etc/fstab}}中使用{{ic|''users''}}(复数)而不是{{ic|user}}选项,您可以使用{{ic|mount}}和{{ic|umount}}命令装卸载文件系统。}}<br />
<br />
==缩放NTFS分区==<br />
<br />
{{Note|对重要数据请提前做好备份!}}<br />
<br />
大多数已购买的系统已经有[[Wikipedia:Windows|Windows]]安装在其上,有些人希望在进行 Arch Linux 安装时不要完全擦除它。因此,在某些方面,调整现有 Windows 分区的大小以为 Linux 分区腾出空间是很有用的。这经常通过[[Wikipedia:Live CD|Live CD]]或可引导的USB闪存驱动器完成。<br />
<br />
对于Live CD,典型的创建过程是下载ISO文件,刻录到CD,然后从它启动。[http://infrarecorder.org/ InfraRecorder]是一个免费(通过GPL3)的Windows上的CD/DVD刻录应用程序,这是很合适的方法。如果您想要使用可引导的USB驱动器,请参阅[[USB flash installation media]]中创建可引导的USB驱动器的方法。<br />
<br />
有许多可引导的CD/USB映像可用。此列表不是详尽无遗的, 但是是个很好的开始:<br />
<br />
* {{App|[[Wikipedia:GParted|GParted]]|为x86计算机设计的小型GNU/Linux发行版。允许你使用最新版GParted应用的所有功能。不包括额外的软件包System Rescue CD,并且磁盘加密可能不受支持。|http://gparted.sourceforge.net/|}}<br />
* {{App|[[Wikipedia:Parted Magic|Parted Magic]]|非常好的完整的硬盘管理解决方案。使用分区编辑器可以调整大小、复制和移动分区。您可以增长或收缩您的 C: 驱动器,为新操作系统创建空间。尝试从丢失的分区中进行数据抢救。|http://partedmagic.com/|}}<br />
* {{App|[[Wikipedia:SystemRescueCD|SystemRescueCD]]|良好的工具, 并在大多数情况下无缝工作。一旦启动, 运行 GParted, 其余应该是相当明显的。|http://www.sysresccd.org/|}}<br />
<br />
请注意, 调整 NTFS 分区大小的重要程序包括 ntfs-3g 和类似于 (G)parted 或 fdisk 的实用程序,由{{Pkg|util-linux}}包提供。除非您是高级用户,否则最好使用像 GParted 这样的工具来执行任何调整大小操作,以尽量减少由于用户错误而导致数据丢失的可能性。<br />
<br />
如果您的系统上已经安装了 Arch Linux,并且只想调整现有 NTFS 分区的大小,则可以使用 parted 和 ntfs-3g 包来完成。或者,在安装 [[GParted]] 包后, 可以使用 GParted GUI。<br />
<br />
== 疑难解答 ==<br />
<br />
=== Compressed files ===<br />
If you have a Windows 10 partition and when accessing files/directories,<br />
# you see broken symbolic links to 'unsupported reparse point', ''or''<br />
# you see the error message "cannot access &lt;''filename''&gt;: Input/output error" (in this case you see in /var/log/messages "Could not load plugin /usr/lib64/ntfs-3g/ntfs-plugin-80000017.so: Success")<br />
then install {{Aur|ntfs-3g-system-compression}}. This plugin handles compressed files.<br />
<br />
<br />
===损坏的NTFS文件系统===<br />
<br />
如果NTFS文件系统有错,ntfs-3g会以只读方式挂载它。要修复NTFS系统,启动Windows并使用它的磁盘检查程序,chkdsk。考虑到 ntfsfix 只能修复一些错误,如果失败,chkdsk 可能会成功。<br />
<br />
想要修复 NTFS 文件系统,该设备必须已经被卸载。例如,想要修复 {{ic|/dev/sda2}} 中的 NTFS 文件系统:<br />
<br />
# umount /dev/sda2<br />
# ntfsfix /dev/sda2<br />
Mounting volume... OK<br />
Processing of $MFT and $MFTMirr completed successfully.<br />
NTFS volume version is 3.1.<br />
NTFS partition /dev/sda2 was processed successfully.<br />
# mount /dev/sda2<br />
<br />
如果顺利的话,该分区已经可以写入了。<br />
<br />
=== 元数据保存在Windows中,拒绝挂载===<br />
<br />
当与 Windows 8 或 10双引导时,试图挂载一个可见的Windows可能会出现如下错误:<br />
<br />
The disk contains an unclean file system (0, 0).<br />
Metadata kept in Windows cache, refused to mount.<br />
Failed to mount '/dev/sdc1': Operation not permitted<br />
The NTFS partition is in an unsafe state. Please resume and shutdown<br />
Windows fully (no hibernation or fast restarting), or mount the volume<br />
read-only with the 'ro' mount option.<br />
<br />
问题是因为Windows 8中引入"快速启动"特性。启用快速启动后,所有分区的元数据的一部分被还原到它们在以前关闭的状态。因此,在 Linux 上所做的更改可能会丢失。这会发生在任何选择"关闭"或"休眠" NTFS 分区的Windows 8 或 10 下。然而,通过选择"重新启动"关闭 Windows 是安全的。<br />
<br />
要启用对其他操作系统的系统分区写入,请确保禁用快速重启。通过以管理员身份执行命令:<br />
<br />
powercfg /h off<br />
<br />
你可以在 ''控制面板 >硬件与声音> 电源选项 > 系统设置 > 当电源键按下时做什么'', 去掉勾选''启用快速启动''<br />
<br />
=== 删除Windows休眠元数据 ===<br />
<br />
作为一个以上干净关机方法的替代方法,有一个办法可以彻底删除休眠后保存的 NTFS 元数据。这个方法只适用于当你不能或不想启动至 Windows,并希望它完全关闭。这个办法是在使用 ntfs-3g 挂载 NTFS 分区时使用 '''remove_hiberfile''' 选项。<br />
<br />
# mount -t ntfs-3g -o remove_hiberfile /dev/''your_NTFS_partition'' ''/mount/point''<br />
<br />
{{警告|这个方法意味着已保存的 Windows 会话将彻底丢失。使用该选项后果自负。}}<br />
<br />
=== 挂载失败 ===<br />
<br />
如果你按本指南内容操作也无法挂载你的 NTFS 分区,可以尝试一下在 {{ic|fstab}} 中的所有 ntfs 分区里加上 [[UUID]]。参见 [[Fstab (简体中文)#UUID|示例]].<br />
<br />
=== Windows mount failure ===<br />
<br />
Windows will not recognize a NTFS partition that does not have a corresponding partition type. A common pitfall when creating an NTFS partition to work with Windows is forgetting to set the partition type as NTFS. See [[fdisk]] or one of the [[partitioning tools]].<br />
<br />
== Beta features & releases ==<br />
There is a [http://jp-andre.pagesperso-orange.fr/advanced-ntfs-3g.html web page ] on "advanced features" (add-ons) [1], maintained by Jean-Pierre André, one of the ntfs-3g authors. That page also provides new versions, not yet incorporated to the official releases.<br />
<br />
Currently these add-ons support:<br />
* System compression<br />
* OneDrive<br />
* Duplicated files<br />
<br />
In the page [1] there is a pointer to the "updated version" of the system compression plugin [[#Compressed files|mentioned above]]. In fact, the update is small; all updates are in:<br />
* README.md<br />
* configure.ac, with slight modification. See the attachment<br />
<br />
The web page [1] is surely written by J.-P. André. The page [https://www.tuxera.com/community/ntfs-3g-advanced/ NTFS-3G Advanced] in the official site in tuxera.com has a link to the [http://jp-andre.pagesperso-orange.fr/openindiana-ntfs-3g.html OpenIndiana page], which in turn links to [1].<br />
<br />
<br />
== 参见 ==<br />
<br />
* [http://www.tuxera.com/community/ntfs-3g-manual/ 官方 NTFS-3G 指南]</div>Cjc7373https://wiki.archlinux.org/index.php?title=Wine_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)&diff=584366Wine (简体中文)2019-10-03T13:19:46Z<p>Cjc7373: 更正标题</p>
<hr />
<div>[[Category:Wine (简体中文)]]<br />
[[cs:Wine]]<br />
[[de:Wine]]<br />
[[en:Wine]]<br />
[[es:Wine]]<br />
[[fr:Wine]]<br />
[[it:Wine]]<br />
[[ja:Wine]]<br />
[[ru:Wine]]<br />
[[zh-hant:Wine]]<br />
{{TranslationStatus (简体中文)|Wine|2015-08-5|389504}}<br />
{{Related articles start (简体中文)}}<br />
{{Related|Steam}}<br />
{{Related|CrossOver}}<br />
{{Related articles end}}<br />
[[Wikipedia:Wine (software)|Wine]] 是类UNIX系统下运行微软Windows程序的"兼容层"。在Wine中运行的Windows程序,就如同运行原生Linux程序一样,不会有模拟器那样的性能问题。<br />
<br />
获取更详细的介绍请浏览[http://www.winehq.org/ 项目官方网站]和[http://wiki.winehq.org/ wiki]页面。<br />
<br />
== 安装 ==<br />
{{警告|如果您的账户能浏览某些文件或资源,Wine运行的程序也可以。Wine不是[[wikipedia:Sandbox (computer security)|沙箱]]。如果很重视安全,请考虑使用[[wikipedia:Virtualization|虚拟化]]。}}<br />
<br />
Wine可通过开启[[Multilib]]仓库来安装{{Pkg|wine}}(稳定版本)or{{Pkg|wine-staging}}(测试版本)。[http://www.wine-staging.com/ Wine-Staging]包括目前上游未采纳的补丁,专门为wine开发者在向上游打补丁前测试。<br />
<br />
另外,您可能需要安装 {{pkg|wine_gecko}} 和 {{pkg|wine-mono}} 软件包。它们分别用于运行依赖于 Internet Explorer 和 .NET 的程序。不过,也可以随后通过 Wine 在需要时下载安装这些组件。但如果提前下载安装,您就可以离线使用它们,而且 Wine 不必为了每一个 WINEPREFIX 都单独下载。<br />
<br />
'''平台差异'''<br />
<br />
默认的Wine是32位的程序,也是i686的Arch软件包。所以它不能运行64位的Windows程序(反正是罕见的)。<br />
<br />
然而,x86_64的Wine软件包目前以{{ic| --enable-win64}}方式编译。这个参数激活了[[Wikipedia:WoW64|WoW64]]的Wine版本。<br />
<br />
*在Windows中,这个复杂的子系统允许用户同时使用32位和64位的Windows程序,甚至是在同一目录。<br />
<br />
*在Wine中,用户将必须建立单独分开的目录/前缀。这项Wine功能仍是试验阶段,并建议用户使用一个win32{{ic|WINEPREFIX}}。浏览[http://wiki.winehq.org/Wine64 Wine64]以获取有关这个的详细信息。<br />
<br />
总结一下,配置{{ic|1=WINEARCH=win32}}后,x86_64平台的Arch和i686平台的Arch完全相同。<br />
<br />
{{注意|如果在64位环境中执行{{ic|winetricks}}或其它程序出现问题,请试试创建一个新的32位{{ic|WINEPREFIX}}. 参见下面的[[#使用 WINEARCH]]{{Broken section link}}}}<br />
<br />
== 配置 ==<br />
配置Wine的方式通常有:<br />
* [http://wiki.winehq.org/winecfg winecfg]是Wine的图形界面配置程序。控制台下调用{{ic|$ winecfg}}(或指定系统目录:{{ic|1=$ WINEPREFIX=~/.系统目录 winecfg}})即可启动<br />
* [http://wiki.winehq.org/control control.exe]是Windows控制面板的Wine实现,通过{{ic|$ wine control}}命令启动<br />
* [http://wiki.winehq.org/regedit regedit]是Wine的注册表编辑器,比较前两者,该工具能配置更多东西。部分常用键值参见:[http://wiki.winehq.org/UsefulRegistryKeys WineHQ's article on Useful Registry Keys]<br />
<br />
=== WINEPREFIX ===<br />
Wine默认将配置文件和安装的Windows程序保存在{{ic|~/.wine}}。这样的目录称为一个"Wine prefix"或"Wine bottle"(保留原文,下文称“系统目录”)。每次运行Windows程序(包括内置程序,如{{ic|winecfg}})时,系统目录会自动创建(如果缺失)或更新。系统目录中存放有相当于Windows下{{ic | C:\}}C盘(更确切的说应是系统盘)的文件夹。<br />
<br />
通过设置{{ic|WINEPREFIX}}环境变量,可以更改Wine系统目录的位置。如果希望让不同的Windows程序使用不同的系统环境或配置,这一变量会非常有用。<br />
<br />
例如,如果您使用 <br />
{{ic |1= $ env WINEPREFIX=~/.win-a wine-A程序.exe}}参数来运行一个程序。另一个使用<br />
{{ic |1= $ env WINEPREFIX=~/.win-b wine-B程序.exe}}参数,这两个程序将使用独立的C盘和注册表配置。<br />
<br />
以下命令会建立一个默认的系统目录,且不启动任何Windows程序:<br />
$ env WINEPREFIX=~/.customprefix wineboot -u<br />
===WINEARCH ===<br />
对于64位用户,如果使用[multilib]仓库里的Wine,默认创建的系统目录是64位环境的。若想使用纯32位环境,修改{{ic|WINEARCH}} 变量win32为即可:<br />
{{ic |1=$ WINEARCH=win32 winecfg}}这样就会生成32位Wine环境。若不设置{{ic|WINEARCH}}得到的就是64位环境。<br />
<br />
通过{{ic|WINEPREFIX}}变量,在不同的系统目录分别创建32位和64位环境:<br />
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg <br />
$ WINEPREFIX=~/win64 winecfg<br />
<br />
{{注意|系统目录创建过程中,64位版本的wine将视全部目录如同64位系统目录,也将不会在已存在的目录中创建任何32位的.创建32位系统目录,您必须让Wine创建指定的{{ic|WINEPREFIX}}目录。}}<br />
<br />
winetricks也接受{{ic|WINEPREFIX}}变量,以安装Steam为例:<br />
env WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam<br />
<br />
To have them permanently defined for [[Bash#Shell and environment variables|bash configuration ~/.bashrc]] do:<br />
<br />
export WINEPREFIX=$HOME/.config/wine/<br />
export WINEARCH=win32<br />
{{小贴士|编辑 [[Bash (简体中文)#外壳和环境变量|~/.bashrc]],使得 WINEPREFIX 和 WINEARCH 永久生效。}}<br />
{{注意|不必手动在 {{ic|wineprefixes}} 文件夹下建立 steam 文件夹,Wine会自动创建不存在的系统目录。}}<br />
<br />
=== 显卡驱动 ===<br />
使用Wine运行Windows游戏时,可能需要高性能的显卡驱动。[[NVIDIA (简体中文)|Nvidia]]、[[ATI (简体中文)|Amd/ATI]]用户最好使用闭源驱动。[[Intel (简体中文)|Intel]]显卡用户也可以选择开源驱动,它已经非常成熟。<br />
<br />
要是显卡驱动有问题或者相关配置有误,控制台用Wine运行某些程序时会输出:<br />
Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly<br />
<br />
x86-64用户需要从[[multilib]]或[[AUR (简体中文)|AUR]]安装额外的32位库:<br />
* '''NVIDIA''':{{Pkg|lib32-nvidia-libgl}}{{Broken package link|replaced by {{Pkg|lib32-nvidia-utils}}}} 至于老显卡,请到 AUR 搜索 '''lib32-nvidia-utils''' (如-173xx)。<br />
* '''NVIDIA (开源驱动)''':{{Pkg|lib32-mesa}}。<br />
* '''Intel''': {{Pkg|lib32-mesa}}。运行Wine时需要手动添加{{ic|1=LIBGL_DRIVERS_PATH=/usr/lib32/xorg/modules/dri}}<br />
* '''AMD/ATI''':{{AUR|lib32-catalyst-utils}}。<br />
* '''AMD/ATI (开源驱动)''': {{Pkg|lib32-mesa}}。<br />
<br />
{{注意|安装上述软件包后,可能需要重启X才能生效!}}<br />
<br />
=== 声音 ===<br />
Wine程序有可能遇到某些声音问题。首先,确保{{ic|winecfg}}中只启用了一种声卡驱动。目前,Wine对[[Alsa (简体中文)|Alsa]]的支持最好。<br />
<br />
x86_64平台下使用[[Alsa (简体中文)|Alsa]]的话,需要安装{{Pkg|lib32-alsa-lib}}。如果还要使用PulseAudio,则需安装{{Pkg|lib32-libpulse}}。<br />
<br />
若使用[[OSS (简体中文)|OSS]],需要安装{{Pkg|lib32-alsa-oss}}。仅靠内核驱动是不行的。<br />
<br />
安装上述软件包后,若{{ic|winecfg}}'''仍'''无法识别声卡(Selected driver: (none)),请尝试[http://wiki.jswindle.com/index.php/Wine_Registry#Configuring_Sound registry 通过注册表配置]。<br />
<br />
运行使用某些高级声音系统的游戏,可能还需要安装{{Pkg|lib32-openal}}。<br />
==== MIDI 支持 ====<br />
<br />
[[MIDI]] was a quite popular system for video games music in the 90's. If you are trying out old games, it is not uncommon that the music will not play out of the box.<br />
Wine has excellent MIDI support. However you first need to make it work on your host system. See the wiki page for more details. Last but not least you need to make sure Wine will use the correct MIDI output. See the [http://wiki.winehq.org/MIDI Wine Wiki] for a detailed setup.<br />
<br />
=== 其他函数库 ===<br />
<br />
*某些程序(如 Office 2003)需要解析HTML、XML(使用MSXML库),需要安装{{Pkg|lib32-libxml2}}。<br />
<br />
*播放音频的程序可能依赖{{Pkg|lib32-mpg123}}。<br />
<br />
*使用色彩管理引擎的一些应用 (例如: PDF查看器, 图片查看器, etc) may require {{Pkg|lib32-lcms2}}.<br />
<br />
*对于使用图像处理库的程序,可能依赖{{Pkg|lib32-giflib}}和{{Pkg|lib32-libpng}},<br />
<br />
*x86_64的加密支持需要{{Pkg|lib32-gnutls}}软件包。<br />
<br />
=== 字体 ===<br />
<br />
如果没有安装微软Truetype字体,Wine程序的字体显示可能会一团糟,参见[[MS Fonts (简体中文)]]。如果还是不行,试试{{ic|winetricks allfonts}}。<br />
<br />
上述操作后,杀死wine相关进程再运行{{ic|winecfg}},字体应该变好看了。<br />
<br />
如果字体看起来很毛糙,试试用[http://wiki.winehq.org/regedit regedit]导入下列文本文件:<br />
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]<br />
"ClientSideWithRender"="N"<br />
{{提示|高分辨率显示器,可在winecfg的显示选项卡中适当dpi的值,例如缩放150%,将dpi设置为144。}}<br />
参阅 [[Font configuration#Applications without fontconfig support]].<br />
<br />
=== 启动器和菜单 ===<br />
<br />
Wine不会为内置程序(如{{ic|winecfg}}、{{ic|winebrowser}})创建桌面启动器和菜单项。但手动安装的Windows程序通常会自动创建启动器和菜单项。在Windows下,安装程序(如{{ic|setup.exe}})通常会在桌面和开始菜单建立快捷方式,而Wine下会创建遵循freedesktop.org规范的.desktop文件(即启动器,相当于快捷方式)。<br />
<br />
{{小贴士|如果启动器''没有''自动创建,或者这些文件丢失了,可以尝试使用[http://wiki.winehq.org/winemenubuilder winemenubuilder]修复。}}<br />
<br />
Ubuntu下,Wine项目以子菜单形式出现在系统菜单。以下步骤将实现这个效果:<br />
<br />
==== 创建菜单项 ====<br />
首先,用Wine安装一个Windows程序,以建立基本的菜单。完成后,向其中添加菜单项。桌面右键选择{{ic|"创建启动器..."}}(不同桌面环境操作有所差异),设置如下:<br />
'''类型(Type)''': 应用程序(Application)<br />
'''名称(Name)''': 配置<br />
'''命令(Command)''': winecfg<br />
'''备注(Comment)''': Wine配置工具<br />
<br />
'''类型''': 应用程序<br />
'''名称''': 卸载程序<br />
'''命令''': wine uninstaller<br />
'''备注''': 卸载Wine下的Windows程序<br />
<br />
'''类型''': 应用程序<br />
'''名称''': 浏览 C:\<br />
'''命令''': wine winebrowser c:\\<br />
'''备注''': 浏览Wine中虚拟的C盘<br />
现在,桌面上出现了三个启动器,下面将把它们移入菜单。不过首先,我们给这些启动器加上动态图标(由图标主题提供)。方法是,用文本编辑器打开启动器,编辑Icon项目:<br />
<br />
{{ic|配置}} 启动器:<br />
Icon=wine-winecfg<br />
{{ic|卸载程序}} 启动器:<br />
Icon=wine-uninstaller<br />
{{ic|浏览 C:\}} 启动器:<br />
Icon=wine-winefile<br />
{{小贴士|多数桌面环境在上述“创建启动器”步骤即可设置图标。以第一个启动器为例,在选择图标窗口中搜索wine-winecfg,选择即可,无需手动编辑。 ——译者注}}<br />
如果图标无法显示或者你觉得很丑陋,换成其他图标也可以。右键设置启动器,应该有更改图标的地方。很多图标主题,例如[http://www.gnome-look.org/content/show.php/GNOME-colors?content=82562 GNOME-colors],都提供这些图标。<br />
<br />
现在,将启动器移入菜单。把启动器复制到 {{ic|~/.local/share/applications/wine/}} 目录即可。<br />
<br />
诶?图标还没出现在菜单中!还剩下最后一步,创建下列文本文件:<br />
{{hc|~/.config/menus/applications-merged/wine-utilities.menu|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"><br />
<Menu><br />
<Name>Applications</Name><br />
<Menu><br />
<Name>wine-wine</Name><br />
<Directory>wine-wine.directory</Directory><br />
<Include><br />
<Filename>wine-Configuration.desktop</Filename><br />
</Include><br />
<Include><br />
<Filename>wine-Browse C:\.desktop</Filename><br />
</Include><br />
<Include><br />
<Filename>wine-Uninstall Programs.desktop</Filename><br />
</Include><br />
</Menu><br />
</Menu><br />
</nowiki>}}<br />
再看看菜单,应该万事大吉了。<br />
<br />
==== Gnome3 中清理 Wine 菜单启动项 ====<br />
系统全局的菜单启动器安装在 {{ic|/usr/share/applications/}},清除相应程序的“.desktop”文件即可从整个系统删除该启动器。<br />
<br />
如果这样还是无法解决问题,那么很可能 Wine 的启动器存放在用户级别的 {{ic|~/.local/share/applications/wine/Programs/}} 目录中。删除相应的“.desktop”文件即可清理对应启动项。删除整个 Programs 文件夹将清理所有 Wine 程序的启动项。<br />
<br />
==== 修复 KDE 4 菜单问题 ====<br />
Wine菜单项有可能[https://bugs.launchpad.net/ubuntu/+source/wine/+bug/263041 错误地出现]在{{ic|"Lost & Found(其他)"}} ,而非Wine子菜单。原因是kde-applications.menu文件缺失{{ic|MergeDir}}配置。<br />
<br />
编辑{{ic|/etc/xdg/menus/kde-applications.menu}}。<br />
<br />
在文件末尾处,{{ic|<DefaultMergeDirs/>}}后添加{{ic|<MergeDir>applications-merged</MergeDir>}}。修改后内容大致如下:<br />
<Menu><br />
<Include><br />
<And><br />
<Category>KDE</Category><br />
<Category>Core</Category><br />
</And><br />
</Include><br />
<DefaultMergeDirs/><br />
'''<MergeDir>applications-merged</MergeDir>'''<br />
<MergeFile>applications-kmenuedit.menu</MergeFile><br />
</Menu><br />
<br />
另一个方法是:<br />
ln -s ~/.config/menus/applications-merged ~/.config/menus/kde-applications-merged<br />
<br />
这样的好处是,不会因为KDE升级而重置配置。但该方法只对一个用户有效。<br />
<br />
== 运行 Windows 程序 ==<br />
{{警告|千万不要以root身份运行Wine!详情参见[http://wiki.winehq.org/FAQ#run_as_root 本文]。}}<br />
运行Windows程序:<br />
$ wine <exe文件><br />
<br />
内置的msiexec程序可以运行MSI安装包:<br />
$ msiexec /i ''path_to_msi''<br />
<br />
== 技巧和技巧 ==<br />
{{小贴士|此外您可能会感兴趣以下文章的开始所提供的链接<br />
* [http://appdb.winehq.org/ Wine程序数据库 (Wine Application Database, AppDB)] —— 特定Windows程序的Wine兼容情况(运行时的已知问题、用户评分、指南等等)<br />
* [http://forum.winehq.org/ WineHQ论坛] —— 要是看完上述网页还有问题,可以到这里咨询<br />
}}<br />
<br />
这里介绍一些安装Windows组件的工具。由于这些工具可能严重破坏Wine配置,没有需要时最好不要使用。<br />
<br />
=== 取消注册Wine文件关联 ===<br />
<br />
在默认情况下,Wine接管了许多扩展名. 一些扩展名 {例如 {{ic|.vbs}} 或者 {{ic|.chm}}) 是Windows专用, 用Wine打开这些程序是很方便的. 但是, 有一些其他格式 (例如 {{ic|gif}}, {{ic|jpeg}}, {{ic|txt}}, {{ic|js}}) 在Wine中用 {{ic|Internet Explorer}} 和 {{ic|Windows记事本}} 打开会出错 .<br />
<br />
Wine的文件关联设置在 {{ic|~/.local/share/applications/}} 像 {{ic|wine-extension-{extension}.desktop}} 这样的文件中. 删除与要取消注册的扩展名相对应的文件. 或者像这样删除所有的扩展名:<br />
<br />
$ rm -f ~/.local/share/applications/wine-extension*.desktop<br />
$ rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*<br />
<br />
Next, remove the old cache:<br />
<br />
$ rm -f ~/.local/share/applications/mimeinfo.cache<br />
$ rm -f ~/.local/share/mime/packages/x-wine*<br />
$ rm -f ~/.local/share/mime/application/x-wine-extension*<br />
<br />
And, update the cache:<br />
<br />
$ update-desktop-database ~/.local/share/applications<br />
<br />
Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.<br />
=== Dual Head with different resolutions ===<br />
<br />
If you have issues with dual-head setups and different display resolutions you are probably missing {{Pkg|lib32-libxrandr}}.<br />
<br />
=== exe-thumbnailer ===<br />
<br />
This is a small piece of UI code meant to be installed with (or even before) Wine. It provides thumbnails for executable files that show the embedded icons when available, and also gives the user a hint that Wine will be used to open it. Details can be found at [http://wiki.winehq.org/exe-thumbnailer Wine wiki]. Install it with the {{AUR|gnome-exe-thumbnailer}}{{Broken package link|package not found}} package.<br />
<br />
=== CSMT patch ===<br />
{{Out of date|See wine-staging below}}<br />
Currently [http://www.winehq.org/pipermail/wine-devel/2013-September/101106.html wine developers] experiment with stream/worker thread optimizations for Wine. You may experience an enormous performance improvement by using this experimental patched Wine versions. Many games may run as fast as on Windows or even faster. This Wine patch is is known as CSMT patch and works with NVidia and AMD graphics cards.<br />
<br />
{{Note|This is ''still experimental code'', therefore, it may not work as expected. Please, report your experiences to the developers for helping with development of those patches.}}<br />
<br />
The easy way is to install {{Pkg|playonlinux}}. Then install your game and activate the Wine version ''1.7.4-CSMT'' from the {{ic|Tools}} → {{ic|Manage Wine Versions}} menu in PlayOnLinux. For now it is recommended to use the patched Wine version ''1.7.4-CSMT''.<br />
<br />
Open your game's configuration settings and copy the following settings to the {{ic|Miscellaneous}}/{{ic|Command to exec before running the program}} section of your game configuration settings:<br />
<br />
export WINEDEBUG=-all<br />
export LD_PRELOAD="libpthread.so.0 libGL.so.1"<br />
export __GL_THREADED_OPTIMIZATIONS=0<br />
export __GL_SYNC_TO_VBLANK=1<br />
export __GL_YIELD="NOTHING"<br />
export CSMT=enabled<br />
<br />
Make sure you have disabled {{ic|StrictDrawOrdering}} from {{ic|Tools}} → {{ic|General}}.<br />
<br />
=== CSMT via wine-staging ===<br />
[http://www.wine-staging.com/ Wine-staging] includes CSMT support, and can be installed with the {{Pkg|wine-staging}} package, or directly via the wine-staging [https://github.com/wine-compholio/wine-staging/wiki/Installation#-arch-linux Arch Linux repo].<br />
<br />
CSMT support needs to be enabled before it can be used, instructions can be found [https://github.com/wine-compholio/wine-staging/wiki/CSMT#enabledisable-csmt here], no further configuration is needed.<br />
==== Further Information ====<br />
<br />
[http://www.phoronix.com/forums/showthread.php?93967-Wine-s-Big-Command-Stream-D3D-Patch-Set-Updated/page3&s=7775d7c3d4fa698089d5492bb7b1a435 Phoronix Forum discussion] with the CSMT developer Stefan Dösinger<br />
<br />
[http://wiki.winehq.org/FOSDEM2014?action=AttachFile&do=get&target=d3d-drivers.odp FOSDEM2014 CSMT presentation] of CSMT with benchmarks<br />
<br />
[https://www.youtube.com/playlist?list=PL0P2a_sII2eTd8uq-azTNpQjiFLqBhDjg Here] you find some game videos running with CSMT enabled<br />
<br />
=== Changing the language ===<br />
<br />
Some programs may not offer a language selection, they will guess the desired language upon the sytem locales. Wine will transfer the current environment (including the locales) to the application, so it should work out of the box. If you want to force a program to run in a specific locale (which is fully [[Locale|generated]] on your system), you can call Wine with the following setting:<br />
<br />
LC_ALL=''xx_XX.encoding'' wine ''/path/to/program''<br />
<br />
For instance<br />
<br />
LC_ALL=it_IT.UTF-8 wine ''/path/to/program''<br />
<br />
=== 安装 Microsoft Office ===/<br />
<br />
更新(2013年4月9日):对于 Wine 1.5.27,下面所述的步骤已经不必要了。先安装 winbind(包含在 {{pkg|samba}} 中),然后执行: <br />
<br />
$ export WINEPREFIX="<用户家目录中的某一可写目录>" <br />
$ export WINEARCH="win32"<br />
$ wine /到/office安装盘/的路径/setup.exe<br />
<br />
可以把上述 export 语句加入 bashrc 文件。<br />
<br />
安装结束后,打开 Word 或 Excel,联网激活。完成后,关闭程序,执行 '''winecfg''',在“函数库”选项卡中把 riched20 设置为“Native (Windows)”。这样 PowerPoint 就可以正常工作。<br />
(使用 Office Home/Student 2010 和 wine 1.5.27 测试。在线激活有效)<br />
<br />
安装Office套装前,需要先安装某些Windows组件:<br />
<br />
$ WINEARCH=win32 WINEPREFIX=/path/to/wineprefix winecfg<br />
# pacman -S winetricks<br />
$ winetricks msxml3 # For MS Office 2007<br />
$ winetricks msxml3 msxml6 # For MS Office 2010<br />
$ wine /path/to/office_cd/setup.exe<br />
<br />
更多信息,参见[http://appdb.winehq.org/appview.php?iVersionId=4992 WineHQ上的文章]。<br />
<br />
{{注意|{{Pkg|playonlinux}} 提供了一个自定义安装脚本,简化了 Office 2003、2007 和 2010 的安装。您只需提供 setup.exe 或 ISO 文件,这个脚本就可以指导您完成安装,完全不需要自己设置 Wine。}}<br />
=== Proper mounting of optical media images ===<br />
<br />
Some applications will check for the optical media to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in ''winecfg''.<br />
However, other applications will look for a media name and/or a serial number, in which case the image has to be mounted with these special properties.<br />
<br />
Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDEmu will handle it correctly.<br />
=== Burning optical media ===<br />
<br />
To burn CDs or DVDs, you will need to load the {{ic|sg}} [[kernel module]].<br />
<br />
=== OpenGL 模式 ===<br />
很多游戏(比如魔兽争霸啦)都支持OpenGL模式,在Wine下''可能''比默认DirectX模式性能更好。一般添加{{Ic|-opengl}}启动程序即可,但''不同程序可能有所不同'':<br />
$ wine /path/to/3d_game.exe -opengl<br />
<br />
请参考[http://appdb.winehq.org AppDB],了解特定程序的相关信息。<br />
<br />
=== 将 Wine 作为 Win16/Win32 程序的解释器 ===<br />
<br />
通知内核识别和执行 Win16/Win32 程序的方式:<br />
echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register<br />
To make the setting permanent, create a configuration file in {{ic|/etc/binfmt.d}} with the following contents:<br />
测试效果,若一切正常,可以使该设置永久生效。在 {{ic|/etc/binfmt.d}} 目录创建新的配置文件,内容为:<br />
{{hc|/etc/tmpfiles.d/wine.conf|<br />
:DOSWin:M::MZ::/usr/bin/wine:}}<br />
<br />
说明一下,和 initscripts 不同,systemd 会自动挂载 {{ic|/proc/sys/fs/binfmt_misc}},所以只需要通过临时文件机制向内核写入配置即可。<br />
<br />
更多信息,参见 [[Systemd (简体中文)#临时文件]]。<br />
<br />
现在,直接运行Windows程序试试:<br />
chmod 755 exefile.exe<br />
./exefile.exe<br />
<br />
=== Wine 控制台 ===<br />
<br />
有些时候,可能需要运行{{ic|.exe}}给游戏打补丁,比如给古董游戏添加宽屏支持。这时直接通过Wine运行可能没有用。那么,打开终端,运行一下命令:<br />
<br />
$ wineconsole cmd<br />
<br />
将进入一个和Windows下cmd一样的命令行环境。在该环境下试试也许就可以了。<br />
<br />
=== Winetricks ===<br />
使用[http://wiki.winehq.org/winetricks Winetricks]快速脚本,能够方便地安装许多Windows组件,包括DirectX、msxml(被Office 2007、IE浏览器依赖)visual运行库还有其他更多的。<br />
<br />
您可以使用[[pacman (简体中文)|pacman]]或者从[[AUR (简体中文)|AUR]]上获取{{AUR|winetricks-git}}软件包来安装该工具:<br />
<br />
运行:<br />
<br />
$ winetricks<br />
=== Installing .NET framework 4.0 ===<br />
First create a new 32-bit Wine prefix if you are on a 64-bit system.<br />
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg<br />
<br />
Then install the following packages using winetricks<br />
$ WINEARCH=win32 WINEPREFIX=~/win32 winetricks -q msxml3 dotnet40 corefonts<br />
=== Crackling sound when using PulseAudio ===<br />
If you experience crackling sound in Wine applications when PulseAudio is in use, edit the file {{ic|/etc/pulse/daemon.conf}} by uncommenting the line {{ic|; default-fragment-size-msec &#61; 25}} and setting the value to {{ic|5}} such that it looks like this:<br />
<br />
default-fragment-size-msec = 5<br />
<br />
See [http://wiki.winehq.org/FAQ#head-58290651b9f85c059a8bfc98118a0262e2cca84b here] for further information.<br />
=== 16 Bit Programs ===<br />
Upon running older Windows 9x programs, the following error may be encountered:<br />
<br />
modify_ldt: Invalid argument<br />
err:winediag:build_module Failed to create module for "krnl386.exe",<br />
16-bit LDT support may be missing.<br />
err:module:attach_process_dlls "krnl386.exe16" failed to initialize,<br />
aborting<br />
<br />
In this case, running the following may fix it:<br />
<br />
echo 1 > /proc/sys/abi/ldt16<br />
<br />
Source: [http://www.spinics.net/linux/fedora/fedora-users/msg450821.html Fedora Mailing List]<br />
<br />
=== 解决中文乱码 ===<br />
中文乱码解决,新建一个reg文件(例如 zh.reg)添加如下内容:<br />
<br />
REGEDIT4<br />
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]<br />
"Lucida Sans Unicode"="wqy-microhei.ttc"<br />
"Microsoft Sans Serif"="wqy-microhei.ttc"<br />
"Microsoft YaHei"="wqy-microhei.ttc"<br />
"微软雅黑"="wqy-microhei.ttc"<br />
"MS Sans Serif"="wqy-microhei.ttc"<br />
"Tahoma"="wqy-microhei.ttc" <br />
"Tahoma Bold"="wqy-microhei.ttc"<br />
"SimSun"="wqy-microhei.ttc"<br />
"Arial"="wqy-microhei.ttc"<br />
"Arial Black"="wqy-microhei.ttc"<br />
"宋体"="wqy-microhei.ttc"<br />
"新細明體"="wqy-microhei.ttc"<br />
<br />
{{提示|这里以文泉驿微米黑为例,如果使用其他字体,请到/usr/share/fonts目录下找到该字体的完整名称,例如使用adobe source hans 中号字体,将上面的wqy-microhei.ttc改为SourceHanSansCN-Medium.otf。}}<br />
<br />
然后打开注册表编辑器:<br />
wine regedit<br />
在注册表编辑器界面选择“注册表”--“导入”,导入该wine-fonts.reg文件即可。<br />
或者直接运行:<br />
<br />
$regedit zh.reg<br />
<br />
更多信息参考[http://linux-wiki.cn/wiki/Wine%E7%9A%84%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E4%B8%8E%E5%AD%97%E4%BD%93%E8%AE%BE%E7%BD%AE Wine的中文显示与字体设置]<br />
<br />
== 第三方工具 ==<br />
这些程序有其自己的主页和支持论坛。<br />
<br />
=== CrossOver ===<br />
<br />
[http://www.codeweavers.com/about/ CrossOver] 有单独的[[CrossOver|wiki 页面]].<br />
<br />
=== PlayOnLinux/PlayOnMac ===<br />
[http://www.playonlinux.com/ PlayOnLinux]是一个图形界面的Windows/DOS程序管理器。它提供了一些帮助配置/运行程序的脚本,能够管理多个不同版本的Wine,甚至能对不同程序使用不同Wine版本。参考[http://appdb.winehq.org AppDB],看看哪个Wine版本对你要运行的程序兼容最好。从[[AUR (简体中文)|AUR]]安装{{Pkg|playonlinux}}。<br />
<br />
=== PyWinery ===<br />
[http://code.google.com/p/pywinery/ PyWinery]是一个简单的、图形界面的Wine系统目录管理器,用它可以方便地管理不同系统目录,并从不同系统目录运行程序。同时可以开启winetricks在同一系统目录,打开系统目录所在文件夹, {{ic|winecfg}}, 软件卸载程序和wineDOS。[[AUR (简体中文)|AUR]]中提供了软件包{{AUR|pywinery}}。当你使用很多系统目录(一个打游戏用、一个编程用……)时,这个程序会非常有用。<br />
<br />
它在默认情况下使用winetricks打开{{ic|.exe}}文件,所以你可以选择你有的任何Wine的配置。<br />
<br />
=== Q4wine ===<br />
[http://q4wine.brezblock.org.ua/ Q4Wine] 是一个图形界面的系统目录(wine-prefix)管理器。它的特色是可以把 QT 主题导入 Wine 配置,使两者完美整合。{{AUR|q4wine}} 软件包在 <nowiki>[</nowiki>[[multilib]]] 仓库中提供。<br />
<br />
<br />
== 相关链接 ==<br />
* [http://www.winehq.com/ Wine官方网站]<br />
* [http://appdb.winehq.org/ Wine程序数据库]<br />
* [http://linuxgamingtoday.wordpress.com/2008/02/16/quick-tips-to-speed-up-your-gaming-in-wine/ 加速Wine,显卡及OpenGL高级配置]<br />
* [http://wiki.gotux.net/code:perl:fileinfo FileInfo] —— Find Win32 PE/COFF headers in EXE/DLL/OCX files under linux/unix environment</div>Cjc7373