Manjaro Difference between revisions of "Pacman Overview/zh-cn"

Difference between revisions of "Pacman Overview/zh-cn"

From Manjaro
Tags: Mobile web edit Mobile edit
(Created page with "在默认情况下,pacman 为单色输出,但是,若你使用的终端支持彩色显示,启用彩色输出可以使输出结果更容易阅读。这可以通过删除...")
Tags: Mobile web edit Mobile edit
Line 11: Line 11:
* Pacman 大部分的开发和维护任务,由 Arch Linux 的开发者完成
* Pacman 大部分的开发和维护任务,由 Arch Linux 的开发者完成
* Pacman 只能在命令行下使用,如果你更喜欢图形化的软件包管理器,请查看 [[Special:MyLanguage/Pamac|Pamac]] 或 [[Special:MyLanguage/Octopi|Octopi]]
* Pacman 只能在命令行下使用,如果你更喜欢图形化的软件包管理器,请查看 [[Special:MyLanguage/Pamac|Pamac]] 或 [[Special:MyLanguage/Octopi|Octopi]]
* Pacman 可以只使用官方公布的 Manjaro [[Special:MyLanguage/Repositories_and_Servers|仓库]]。另有单独的文章可用于访问 [[Special:MyLanguage/Arch_User_Repository|Arch 用户软件仓库(AUR)]],使用 [[Special:MyLanguage/Flatpak|flatpaks]] 和使用 [[Special:MyLanguage/Snaps|snaps]]
* Pacman 可以只使用官方公布的 Manjaro [[Special:MyLanguage/Repositories_and_Servers|仓库]]。另有专门的文章介绍,适用于 [[Special:MyLanguage/Arch_User_Repository|Arch 用户软件仓库(AUR)]] [[Special:MyLanguage/Flatpak|flatpaks]] [[Special:MyLanguage/Snaps|snaps]] 软件包




Line 28: Line 28:




=Searching for Packages=
=搜索软件包=


To search the Manjaro repositories for available packages you can use the command {{ic|pacman -Ss keyword}}. It will search both the package name and the description for the keyword.  For example, to search for packages containing the keyword smplayer you could use:
To search the Manjaro repositories for available packages you can use the command {{ic|pacman -Ss keyword}}. It will search both the package name and the description for the keyword.  For example, to search for packages containing the keyword smplayer you could use:
Line 45: Line 45:




=Installing Packages=
=安装软件包=


{{warning|Never install a package without updating the system first.  On a rolling release this can lead to an unbootable system}}
{{warning|Never install a package without updating the system first.  On a rolling release this can lead to an unbootable system}}
Line 67: Line 67:




=Removing Packages=
=移除软件包=


{{warning|Always review the package list before confirming when removing packages.  If you are not careful you can easily remove your entire desktop due to dependencies.}}
{{warning|Always review the package list before confirming when removing packages.  If you are not careful you can easily remove your entire desktop due to dependencies.}}
Line 92: Line 92:
{{UserCmd|command=sudo pacman -Rcn smplayer}}
{{UserCmd|command=sudo pacman -Rcn smplayer}}


=Viewing and Removing Orphans=
=查看并移除孤立的软件包=


To list all ''orphans'', installed packages that are not used by anything else and should no longer be needed:
To list all ''orphans'', installed packages that are not used by anything else and should no longer be needed:
Line 98: Line 98:




To remove all the orphans:
移除所有孤立的软件包:
{{UserCmd|command=sudo pacman -Rs $(pacman -Qdtq)}}
{{UserCmd|command=sudo pacman -Rs $(pacman -Qdtq)}}


Line 111: Line 111:




=Determining which Package Owns a File=
=确定文件所属的软件包=


It is often useful to understand which package installed a file on your system.  This is easy to do with pacman using {{ic|pacman -Qo /path/to/filename}}.  For example:
It is often useful to understand which package installed a file on your system.  This is easy to do with pacman using {{ic|pacman -Qo /path/to/filename}}.  For example:
Line 117: Line 117:




=Cleaning the Cache=
=清除缓存=


When pacman installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time. Systems running [[Special:MyLanguage/Pamac|Pamac]] will already have access to its automated pacman cache cleaning functions.  It is also possible to clean them manually using pacman.
When pacman installs packages, it keeps a copy of all the old packages you have downloaded. This cache can be very useful if you have to install older packages in an emergency. However, left unchecked, this cache will grow very large over time. Systems running [[Special:MyLanguage/Pamac|Pamac]] will already have access to its automated pacman cache cleaning functions.  It is also possible to clean them manually using pacman.
Line 133: Line 133:




=The Configuration File, pacman.conf=
=配置文件 pacman.conf=


Pacman's settings are located in {{ic|/etc/pacman.conf}}.  This file is owned by root, please see [[Special:MyLanguage/Viewing_and_editing_configuration_files|this guide]] if you need more information on how to edit this file.  A full reference to these options can be found in the Arch Wiki linked below.  This sections features some settings that may be of particular interest to Manjaro users.
Pacman's settings are located in {{ic|/etc/pacman.conf}}.  This file is owned by root, please see [[Special:MyLanguage/Viewing_and_editing_configuration_files|this guide]] if you need more information on how to edit this file.  A full reference to these options can be found in the Arch Wiki linked below.  This sections features some settings that may be of particular interest to Manjaro users.
Line 141: Line 141:




==Enabling Color Output==
==启用彩色输出==


By default, pacman's output is monochrome but enabling colored output can make the output easier to read if your terminal supports colors.  This can be enabled by uncommenting or adding the following line to the file
在默认情况下,pacman 为单色输出,但是,若你使用的终端支持彩色显示,启用彩色输出可以使输出结果更容易阅读。这可以通过删除注释或在文件中添加下面一行内容启用。
  Color
  Color


Cookies help us deliver our services. By using our services, you agree to our use of cookies.