Manjaro Difference between revisions of "Pamac/zh-cn"

Difference between revisions of "Pamac/zh-cn"

From Manjaro
(Created page with "=安装 Pamac=")
Tags: Mobile web edit Mobile edit
 
(Updating to match new version of source page)
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
=简介=
=简介=


Pamac (Add/Remove Software) 是 Manjaro 的软件包管理器。它是由 AUR 和 Appstream 基于 libalpm 开发,致力于提供一个简单易用的使用界面,同时仍然提供一些强大的功能。
Pamac(添加/删除软件)是 Manjaro 的软件包管理器。它是由 AUR 和 Appstream 基于 libalpm 开发,致力于在简单易用的使用界面之下提供强大的功能。




Line 11: Line 11:
=安装 Pamac=
=安装 Pamac=


Pamac 已预装在诸多 Manjaro 版本中。不过,即使你的系统中没有这款软件,也可以很轻松的安装它。Pamac 有几个不同的安装包:
Pamac 已预装在诸多 Manjaro 版本中。不过,即使你的系统中没有这款软件,也可以很轻松的安装它。Pamac 有几个不同的软件包:
* {{ic|pamac-gtk}} - Pamac 的 GTK 版本。包含了可用于多个桌面版本的托盘图标。
* {{ic|pamac-gtk}} - Pamac 的 GTK 版本。包含了可用于多个桌面版本的托盘图标。
* {{ic|pamac-cli}} - Pamac 的命令行版本。
* {{ic|pamac-cli}} - Pamac 的命令行版本。
* {{ic|pamac-tray-appindicator}} - 可用于 KDE Plasma 的托盘图标。
* {{ic|pamac-tray-appindicator}} - 用于 KDE Plasma 的托盘图标。




These packages can be installed using pacman.  For example, to install the GTK version, you can use the command:
通过 pacman 可以安装这些软件包。例如,要安装 GTK 版本,你可以使用命令:
sudo pacman -Syu pamac-gtk
{{UserCmd|command=sudo pacman -Syu pamac-gtk}}




{{tip|Both the GTK and Qt Pamac packages will automatically install the CLI version as well}}
{{BoxSuccess|tip|GTK Qt 版本的 pamac 软件包均会一并安装 CLI 版本}}


=Using the Pamac GUI=
=使用 Pamac 图形用户界面=




==Installing Software==
==安装软件==


[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]
[[File:Pamac-gtk-optional-deps.png|left|thumb|400px]]




To install packages simply check check the box next to the packages.  Once you have selected all the packages all the packages you want to install, click the Apply button at the bottom of the page.
要安装软件包,只需勾选软件包旁边的复选框。勾选你想安装的所有软件包之后,点击画面底部的“应用”按钮。




If any of the packages have optional dependencies(packages that enable additional functionality) you will see a window like the one to the left which allows to select the ones you would like to install.
如果这些软件包中有可选依赖项(即用于开启附加功能的软件包),你将看到如左图所示的窗口,可以在其中勾选希望安装的依赖项。
<div style="clear: both"></div>
<div style="clear: both"></div>
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]
[[File:Pamac-gtk-transaction-summary.png|left|thumb|400px]]




After you have selected optional dependencies, you should see a windows similar to the one pictured on the left.  This lists all the packages that will be installed, upgraded or removed by the action.  Once you have reviewed the list, press the Apply button to install the packages.
选择可选依赖项之后,你应当看到如左图所示的窗口。其中分别列出了将要进行安装、升级或移除等动作的所有软件包。在检查列表后,按下“应用”按钮以安装软件包。




<div lang="en" dir="ltr" class="mw-content-ltr">
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn't select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.
You may notice this list has more packages than you selected in the GUI.  This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly.  You may also notice that packages are being removed even though you didn't select any packages to remove.  This is happening in the example to the left where you can see {{ic|clutter}} and {{ic|cogl}} are being removed.  They are being removed because they conflict with {{ic|deepin-clutter}} and {{ic|deepin-cogl}} which provide the same functionality.
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
==Removing Software==
==Removing Software==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]
[[File:Pamac-gtk-remove-summary.png|left|thumb|400px]]
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.
Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.
</div>




Once you do you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.
<div lang="en" dir="ltr" class="mw-content-ltr">
Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed.  You may notice this list contains more packages than you selected.  This is because when you remove a package that other packages depend on, those packages are also removed.
</div>




{{warning|It is extremely important to carefully review the Transaction Summary before accepting the package removal.  Some packages have many packages which depend on them and you don't want to inadvertently remove your whole Desktop Environment}}
<div lang="en" dir="ltr" class="mw-content-ltr">
{{warning|It is extremely important to carefully review the Transaction Summary before accepting the package removal.  Some packages have many packages which depend on them and you don't want to inadvertently remove your whole desktop environment}}
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==Preferences==
==Preferences==
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.
You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]
[[File:Pamac-gtk-preferences-general.png|left|thumb|400px]]
</div>




The General tab of preferences contains several settings, most of which are self explanatory.
<div lang="en" dir="ltr" class="mw-content-ltr">
The General tab of preferences contains several settings, most of which are self-explanatory.
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package
* Remove unrequired dependencies - This removes dependencies which are no longer required by any package
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages
* Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages
* Maximum parallel downloads - The number of concurrent downloads allowed
* Maximum parallel downloads - The number of concurrent downloads allowed
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].
* Enable downgrade - This allows packages to be downgraded as well as upgraded.  This is important when [[Switching_Branches|switching branches]].
* Check for updates - Disabling this will stop Pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.
* Check for updates - Disabling this will stop pamac from looking for updates.  In most cases, turning this off on a [[The Rolling Release Development Model|rolling release]] distro like Manjaro is a bad idea.
* Ignore updates for - This is a list of packages that you don't want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.
* Ignore updates for - This is a list of packages that you don't want to be upgraded.  This is inherently dangerous practice and should only be used by advanced users.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
{{warning|Ignoring updates for individual packages will leave you in an unsupported "partial upgrade" state.  It is common for innocuous looking ignored packages to leave your system unbootable}}
{{warning|Ignoring updates for individual packages will leave you in an unsupported "partial upgrade" state.  It is common for innocuous looking ignored packages to leave your system unbootable}}
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
{{warning|'''DISCLAIMER:''' AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted. Any use of the provided files is at your own risk.}}
{{warning|'''DISCLAIMER:''' AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted. Any use of the provided files is at your own risk.}}
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]
[[File:Pamac-gtk-preferences-aur.png|left|thumb|400px]]
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.
Pamac is also capable of using scripts from the [[Arch User Repository|Arch User Repository(AUR)]] to install or update packages.  Please carefully read the considerations in the [[Arch User Repository|linked page]] prior to enabling support for AUR.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
If you enable AUR support, you may also select, "Check for updates from AUR" so software you install from AUR won't become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.
If you enable AUR support, you may also select, "Check for updates from AUR" so software you install from AUR won't become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
Checking for "development package" updates will allow updates on *-git packages which are built from the latest source code to also be updated.
Checking for "development package" updates will allow updates on *-git packages which are built from the latest source code to also be updated.
</div>




The "Build directory" is where AUR packages will be built.  Using "tmp" usually will provide the best performance but very large packages may fail to build.  In this case, select somewhere with more available space.
<div lang="en" dir="ltr" class="mw-content-ltr">
The "Build directory" is where AUR packages will be built.  Using "tmp" usually will provide the best performance but very large packages may fail to build.  In this case, select a location with more available space.
<div style="clear: both"></div>
<div style="clear: both"></div>
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]
[[File:Pamac-gtk-preferences-cache.png|left|thumb|400px]]
</div>




When Pamac installs packages, it keeps a copy of all the old packages you have downloaded.  This cache can be very useful if you have to download packages in an emergency.  However, left unchecked, this cache will grow very large over time.  These preferences allow your cache to be automatically managed based on your preferences.
<div lang="en" dir="ltr" class="mw-content-ltr">
When pamac 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.  These preferences allow your cache to be automatically managed based on your preferences.
</div>




The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of firefox over the life of your install and you set this number to "3", only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.
<div lang="en" dir="ltr" class="mw-content-ltr">
The first option allows you to set a number for how many copies of each package are retained.  In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to "3", only the most recent 3 versions will be retained.  Unless you are very short on disk space, it is recommended to set this to at least 2.
</div>




By selecting "Remove only the versions of uninstalled packages" pamac will retain all versions of packages you still have installed.
<div lang="en" dir="ltr" class="mw-content-ltr">
By selecting "Remove only the versions of uninstalled packages", pamac will retain all versions of packages you still have installed.
<div style="clear: both"></div>
<div style="clear: both"></div>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
=Using the Pamac CLI=
=Using the Pamac CLI=
</div>


Pamac also includes a fully functional CLI for when you don't have a functional GUI or for those that prefer to manager packages that way.
<div lang="en" dir="ltr" class="mw-content-ltr">
Pamac also includes a fully functional CLI for when you don't have a working GUI or for those that prefer to manage packages that way.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
{{warning|Using sudo with pamac can have undesirable effects, especially when building packages. if in doubt, don’t use sudo. Pamac will ask for escalated rights if needed.}}
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==Locating and Installing Packages==
==Locating and Installing Packages==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:
To search for available packages you can use the command {{ic|pamac search}}.  For example, to search the repos for packages containing the word smplayer:
<pre>pamac search smplayer
<pre>pamac search smplayer
smplayer                                                                                                                                                                                                                                                                                   [Installed] 19.5.0-1    community  
smplayer
[Installed] 19.5.0-1    community  
   Media player with built-in codecs that can play virtually all video and audio formats
   Media player with built-in codecs that can play virtually all video and audio formats
smplayer-skins                                                                                                                                                                                                                                                                             [Installed] 1:15.2.0-2  community  
smplayer-skins
[Installed] 1:15.2.0-2  community  
   Skins for SMPlayer
   Skins for SMPlayer
smplayer-themes                                                                                                                                                                                                                                                                           [Installed] 1:18.6.0-1  community  
smplayer-themes
[Installed] 1:18.6.0-1  community  
   Themes for SMPlayer</pre>
   Themes for SMPlayer</pre>
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:
As you can see, this will also show you which packages are already installed.  If you would like to search both the repos and [[Arch_User_Repository|AUR]] you add {{ic|-a}} like this:
<pre>pamac search -a smplayer
<pre>pamac search -a smplayer
smplayer                                                                                                                                                                                                                                                                             [Installed] 19.5.0-1        community  
smplayer
[Installed] 19.5.0-1        community  
   Media player with built-in codecs that can play virtually all video and audio formats
   Media player with built-in codecs that can play virtually all video and audio formats
smplayer-skins                                                                                                                                                                                                                                                                       [Installed] 1:15.2.0-2      community  
smplayer-skins
[Installed] 1:15.2.0-2      community  
   Skins for SMPlayer
   Skins for SMPlayer
smplayer-themes                                                                                                                                                                                                                                                                       [Installed] 1:18.6.0-1      community  
smplayer-themes
[Installed] 1:18.6.0-1      community  
   Themes for SMPlayer
   Themes for SMPlayer
papirus-smplayer-theme-git                                                                                                                                                                                                                                                                       20181024-2       AUR  
papirus-smplayer-theme-git
20181024-2       AUR  
   Papirus theme for SMPlayer (git version)
   Papirus theme for SMPlayer (git version)
smplayer-svn                                                                                                                                                                                                                                                                                     17.12.0.r8852-1  AUR  
smplayer-svn
17.12.0.r8852-1  AUR  
   Advanced front-end for MPlayer/MPV
   Advanced front-end for MPlayer/MPV
smplayer-svn-notitlebar                                                                                                                                                                                                                                                                           18.3.0.r8982M-1  AUR  
smplayer-svn-notitlebar
18.3.0.r8982M-1  AUR  
   Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode
   Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode
smplayer-skins-svn                                                                                                                                                                                                                                                                               15.2.0.r8852-1   AUR  
smplayer-skins-svn
15.2.0.r8852-1   AUR  
   Skins for SMPlayer
   Skins for SMPlayer
smplayer-themes-svn                                                                                                                                                                                                                                                                               17.3.0.r8852-1   AUR  
smplayer-themes-svn
17.3.0.r8852-1   AUR  
   Themes for SMPlayer
   Themes for SMPlayer
smplayer-qt4                                                                                                                                                                                                                                                                                     18.5.0-1         AUR  
smplayer-qt4
18.5.0-1         AUR  
   Complete front-end for MPlayer/MPV (Qt4)
   Complete front-end for MPlayer/MPV (Qt4)
rosa-media-player-plugin                                                                                                                                                                                                                                                                         1.0-2           AUR  
rosa-media-player-plugin
1.0-2            AUR  
   The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).
   The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).
smplayer-theme-faenza (Out of Date: 09/15/2017)                                                                                                                                                                                                                                                   2-2             AUR  
smplayer-theme-faenza (Out of Date: 09/15/2017)
2-2              AUR  
   Normal, dark and silver faenza theme for smplayer.
   Normal, dark and silver faenza theme for smplayer.
umplayer                                                                                                                                                                                                                                                                                         0.98.2-2         AUR  
umplayer
0.98.2-2         AUR  
   An alternative to SMPlayer</pre>
   An alternative to SMPlayer</pre>
</div>




Once you have identified the packages you wish to install you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac install smplayer smplayer-themes
Once you have identified the packages you wish to install, you can install them with command {{ic|pamac install}}.  For example, if we wanted to install {{ic|smplayer}} and {{ic|smplayer-themes}} we could use the command:
{{UserCmd|command=pamac install smplayer smplayer-themes}}
</div>




{{tip|When using install pamac will check to see if packages are installed and only install the ones not already installed}}
<div lang="en" dir="ltr" class="mw-content-ltr">
{{BoxSuccess|tip|When using install, pamac will check to see if packages are installed and only install the ones not already installed}}
</div>




If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could the command:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac build umplayer
If you want to install packages from [[Arch_User_Repository|AUR]] you use the command {{ic|pamac build}}.  Sticking with the above example, if you decided you wanted to install {{ic|umplayer}} instead you could use the command:
 
{{UserCmd|command=pamac build umplayer}}
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==Removing Packages==
==Removing Packages==
</div>


The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example if you wanted to remove all the packages installed above you could use the command:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac remove smplayer smplayer-themes umplayer
The command {{ic|pamac remove}} can be used to uninstall packages installed from the repos or [[Arch_User_Repository|AUR]].  For example, if you wanted to remove all the packages installed above, you could use the command:
{{UserCmd|command=pamac remove smplayer smplayer-themes umplayer}}
</div>






{{warning|It is extremely important to carefully review the list of packages pamac presents before confirming.  Some packages have many packages which depend on them and you don't want to inadvertently remove your whole Desktop Environment}}
<div lang="en" dir="ltr" class="mw-content-ltr">
{{BoxSuccess|warning|It is extremely important to carefully review the list of packages pamac presents before confirming.  Some packages have many packages which depend on them and you don't want to inadvertently remove your whole desktop environment}}
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
==Identifying Installed Packages==
==Identifying Installed Packages==
</div>


To display a list of all installed packages you can use the command:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac list -i
To display a list of all installed packages, you can use the command:
 
{{UserCmd|command=pamac list -i}}
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
==Displaying Detailed Package Information==
==Displaying Detailed Package Information==
</div>


To display detailed information on a package that is in the repos or installed on your system use the command {{ic|pamac info}}.  Keeping with our example:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac info smplayer
To display detailed information on a package that is in the repos or installed on your system, use the command {{ic|pamac info}}.  Keeping with our example of SMPlayer :
{{UserCmd|command=pamac info smplayer}}
</div>




If you also would like to check packages in [[Arch_User_Repository|AUR]] you could use:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac info -a smplayer
If you also would like to check packages in [[Arch_User_Repository|AUR]], you could use:
{{UserCmd|command=pamac info -a smplayer}}
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
==Updating the System==
==Updating the System==
</div>


To check if updates are available you can use the command:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac checkupdates -a
To check if updates are available, you can use the command:
{{UserCmd|command=pamac checkupdates -a}}
</div>




To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]] you can use the command:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac upgrade -a
To update all installed packages installed from the repos or [[Arch_User_Repository|AUR]], you can use the command:
{{UserCmd|command=pamac upgrade -a}}
</div>




{{tip|pamac update and pamac upgrade are exactly the same.  You can use them interchangably.}}
<div lang="en" dir="ltr" class="mw-content-ltr">
{{BoxSuccess|tip|pamac update and pamac upgrade are exactly the same.  You can use them interchangeably.}}
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
==Dealing with Orphaned Packages==
==Dealing with Orphaned Packages==
</div>


To check to see if there any orphaned packages(packages which are no longer needed) installed you can use:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac list -o
To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:
{{UserCmd|command=pamac list -o}}
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
To remove all orphans use the command:
To remove all orphans use the command:
pamac remove -o
{{UserCmd|command=pamac remove -o}}
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
==Cleaning the Cache==
==Cleaning the Cache==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
When pamac 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.
When pamac 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.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
Otherwise, to clear the cache completely, enter the following command (and use with care):
Otherwise, to clear the cache completely, enter the following command (and use with care):
pamac clean
{{UserCmd|command=pamac clean}}
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:
A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:
pamac clean --keep 3
{{UserCmd|command=pamac clean --keep 3}}
</div>




<div lang="en" dir="ltr" class="mw-content-ltr">
==Other Useful Pamac Functions==
==Other Useful Pamac Functions==
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:
To see which package owns a certain file on your system, use the command {{ic|pamac search -f}}.  For example:
pamac search -f /usr/bin/smplayer
{{UserCmd|command=pamac search -f /usr/bin/smplayer}}
</div>




To force a package to be installed even if it is already installed use {{ic|pamac reinstall}}.  For example:
<div lang="en" dir="ltr" class="mw-content-ltr">
pamac reinstall smplayer
To force a package to be installed even if it is already installed, use {{ic|pamac reinstall}}.  For example:
{{UserCmd|command=pamac reinstall smplayer}}
</div>


[[Category:Contents Page{{#translation:}}]]
[[Category:Contents Page{{#translation:}}]]

Latest revision as of 04:36, 27 March 2023

Other languages:
Deutsch • ‎English • ‎français • ‎русский • ‎עברית • ‎فارسی • ‎中文(中国大陆)‎

简介

Pamac(添加/删除软件)是 Manjaro 的软件包管理器。它是由 AUR 和 Appstream 基于 libalpm 开发,致力于在简单易用的使用界面之下提供强大的功能。


Pamac-gtk-main.png

安装 Pamac

Pamac 已预装在诸多 Manjaro 版本中。不过,即使你的系统中没有这款软件,也可以很轻松的安装它。Pamac 有几个不同的软件包:

  • pamac-gtk - Pamac 的 GTK 版本。包含了可用于多个桌面版本的托盘图标。
  • pamac-cli - Pamac 的命令行版本。
  • pamac-tray-appindicator - 用于 KDE Plasma 的托盘图标。


通过 pacman 可以安装这些软件包。例如,要安装 GTK 版本,你可以使用命令:

user $ sudo pacman -Syu pamac-gtk COPY TO CLIPBOARD



tip
GTK 和 Qt 版本的 pamac 软件包均会一并安装 CLI 版本

使用 Pamac 图形用户界面

安装软件

Pamac-gtk-optional-deps.png


要安装软件包,只需勾选软件包旁边的复选框。勾选你想安装的所有软件包之后,点击画面底部的“应用”按钮。


如果这些软件包中有可选依赖项(即用于开启附加功能的软件包),你将看到如左图所示的窗口,可以在其中勾选希望安装的依赖项。

Pamac-gtk-transaction-summary.png


选择可选依赖项之后,你应当看到如左图所示的窗口。其中分别列出了将要进行安装、升级或移除等动作的所有软件包。在检查列表后,按下“应用”按钮以安装软件包。


You may notice this list has more packages than you selected in the GUI. This is because many packages also have dependencies which are packages that must be installed in order for the software you selected to function properly. You may also notice that packages are being removed even though you didn't select any packages to remove. This is happening in the example to the left where you can see clutter and cogl are being removed. They are being removed because they conflict with deepin-clutter and deepin-cogl which provide the same functionality.


Removing Software

Pamac-gtk-remove-summary.png


Removing software is as simple as unchecking the packages you want to remove and clicking the Apply button at the bottom of the page.


Once you do, you should see a screen similar to the one on the left which lists all the packages that are about to be removed. You may notice this list contains more packages than you selected. This is because when you remove a package that other packages depend on, those packages are also removed.


Warning
It is extremely important to carefully review the Transaction Summary before accepting the package removal. Some packages have many packages which depend on them and you don't want to inadvertently remove your whole desktop environment

Preferences


You can access the preferences by clicking on the three dots in the upper right corner and selecting preferences.


Pamac-gtk-preferences-general.png


The General tab of preferences contains several settings, most of which are self-explanatory.


  • Remove unrequired dependencies - This removes dependencies which are no longer required by any package
  • Check available disk space - Checks to ensure you have sufficient disk space available before downloading and installing packages
  • Maximum parallel downloads - The number of concurrent downloads allowed
  • Enable downgrade - This allows packages to be downgraded as well as upgraded. This is important when switching branches.
  • Check for updates - Disabling this will stop pamac from looking for updates. In most cases, turning this off on a rolling release distro like Manjaro is a bad idea.
  • Ignore updates for - This is a list of packages that you don't want to be upgraded. This is inherently dangerous practice and should only be used by advanced users.
Warning
Ignoring updates for individual packages will leave you in an unsupported "partial upgrade" state. It is common for innocuous looking ignored packages to leave your system unbootable
Warning
DISCLAIMER: AUR scripts are created for Arch Linux by Arch Linux Users. AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted. Any use of the provided files is at your own risk.
Pamac-gtk-preferences-aur.png

Pamac is also capable of using scripts from the Arch User Repository(AUR) to install or update packages. Please carefully read the considerations in the linked page prior to enabling support for AUR.

If you enable AUR support, you may also select, "Check for updates from AUR" so software you install from AUR won't become outdated. An alternative is creating an account on AURweb and subscribe to notifications for the scripts you are using on a permanent basis.


Checking for "development package" updates will allow updates on *-git packages which are built from the latest source code to also be updated.


The "Build directory" is where AUR packages will be built. Using "tmp" usually will provide the best performance but very large packages may fail to build. In this case, select a location with more available space.

Pamac-gtk-preferences-cache.png


When pamac 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. These preferences allow your cache to be automatically managed based on your preferences.


The first option allows you to set a number for how many copies of each package are retained. In other words, if you have downloaded 25 versions of Firefox over the life of your install and you set this number to "3", only the most recent 3 versions will be retained. Unless you are very short on disk space, it is recommended to set this to at least 2.


By selecting "Remove only the versions of uninstalled packages", pamac will retain all versions of packages you still have installed.

Using the Pamac CLI

Pamac also includes a fully functional CLI for when you don't have a working GUI or for those that prefer to manage packages that way.

Warning
Using sudo with pamac can have undesirable effects, especially when building packages. if in doubt, don’t use sudo. Pamac will ask for escalated rights if needed.


Locating and Installing Packages

To search for available packages you can use the command pamac search. For example, to search the repos for packages containing the word smplayer:

pamac search smplayer
smplayer
[Installed] 19.5.0-1    community 
  Media player with built-in codecs that can play virtually all video and audio formats
smplayer-skins
[Installed] 1:15.2.0-2  community 
  Skins for SMPlayer
smplayer-themes
[Installed] 1:18.6.0-1  community 
  Themes for SMPlayer


As you can see, this will also show you which packages are already installed. If you would like to search both the repos and AUR you add -a like this:

pamac search -a smplayer
smplayer
[Installed] 19.5.0-1         community 
  Media player with built-in codecs that can play virtually all video and audio formats
smplayer-skins
[Installed] 1:15.2.0-2       community 
  Skins for SMPlayer
smplayer-themes
[Installed] 1:18.6.0-1       community 
  Themes for SMPlayer
papirus-smplayer-theme-git
20181024-2       AUR 
  Papirus theme for SMPlayer (git version)
smplayer-svn
17.12.0.r8852-1  AUR 
  Advanced front-end for MPlayer/MPV
smplayer-svn-notitlebar
18.3.0.r8982M-1  AUR 
  Advanced front-end for MPlayer/MPV + Patch to disable titlebar in compact mode
smplayer-skins-svn
15.2.0.r8852-1   AUR 
  Skins for SMPlayer
smplayer-themes-svn
17.3.0.r8852-1   AUR 
  Themes for SMPlayer
smplayer-qt4
18.5.0-1         AUR 
  Complete front-end for MPlayer/MPV (Qt4)
rosa-media-player-plugin
1.0-2            AUR 
  The new multimedia player(based on SMPlayer) with clean and elegant UI (mozilla plugin only).
smplayer-theme-faenza (Out of Date: 09/15/2017)
2-2              AUR 
  Normal, dark and silver faenza theme for smplayer.
umplayer
0.98.2-2         AUR 
  An alternative to SMPlayer


Once you have identified the packages you wish to install, you can install them with command pamac install. For example, if we wanted to install smplayer and smplayer-themes we could use the command:

user $ pamac install smplayer smplayer-themes COPY TO CLIPBOARD


tip
When using install, pamac will check to see if packages are installed and only install the ones not already installed


If you want to install packages from AUR you use the command pamac build. Sticking with the above example, if you decided you wanted to install umplayer instead you could use the command:

user $ pamac build umplayer COPY TO CLIPBOARD

Removing Packages

The command pamac remove can be used to uninstall packages installed from the repos or AUR. For example, if you wanted to remove all the packages installed above, you could use the command:

user $ pamac remove smplayer smplayer-themes umplayer COPY TO CLIPBOARD


warning
It is extremely important to carefully review the list of packages pamac presents before confirming. Some packages have many packages which depend on them and you don't want to inadvertently remove your whole desktop environment


Identifying Installed Packages

To display a list of all installed packages, you can use the command:

user $ pamac list -i COPY TO CLIPBOARD

Displaying Detailed Package Information

To display detailed information on a package that is in the repos or installed on your system, use the command pamac info. Keeping with our example of SMPlayer :

user $ pamac info smplayer COPY TO CLIPBOARD


If you also would like to check packages in AUR, you could use:

user $ pamac info -a smplayer COPY TO CLIPBOARD


Updating the System

To check if updates are available, you can use the command:

user $ pamac checkupdates -a COPY TO CLIPBOARD


To update all installed packages installed from the repos or AUR, you can use the command:

user $ pamac upgrade -a COPY TO CLIPBOARD


tip
pamac update and pamac upgrade are exactly the same. You can use them interchangeably.


Dealing with Orphaned Packages

To check to see if there any orphaned packages (packages which are no longer needed) installed, you can use:

user $ pamac list -o COPY TO CLIPBOARD


To remove all orphans use the command:

user $ pamac remove -o COPY TO CLIPBOARD


Cleaning the Cache

When pamac 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.

Otherwise, to clear the cache completely, enter the following command (and use with care):

user $ pamac clean COPY TO CLIPBOARD

A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:

user $ pamac clean --keep 3 COPY TO CLIPBOARD


Other Useful Pamac Functions

To see which package owns a certain file on your system, use the command pamac search -f. For example:

user $ pamac search -f /usr/bin/smplayer COPY TO CLIPBOARD


To force a package to be installed even if it is already installed, use pamac reinstall. For example:

user $ pamac reinstall smplayer COPY TO CLIPBOARD

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