[[Manjaro]]'s package manager, Pamac ships with most Manjaro editions. All Manjaro editions include [[pacman]], the package manager from upstream [[Arch Linux]]. Pacman includes some advanced features not found in Pamac. Key points to know: - Pacman is already installed in Manjaro Linux by default - Pacman is mainly developed/maintained by Arch Linux developers - Pacman can only be used from the command line, if you would prefer a graphical package manager please see [Pamac](https://wiki.manjaro.org/index.php/Special:MyLanguage/Pamac "Special:MyLanguage/Pamac") or [Octopi](https://wiki.manjaro.org/index.php/Special:MyLanguage/Octopi "Special:MyLanguage/Octopi") - Pacman can only use the official Manjaro [repository](https://wiki.manjaro.org/index.php/Special:MyLanguage/Repositories_and_Servers "Special:MyLanguage/Repositories and Servers"). There are separate articles available for accessing the [Arch User Repository(AUR)](https://wiki.manjaro.org/index.php/Special:MyLanguage/Arch_User_Repository "Special:MyLanguage/Arch User Repository"), using [flatpaks](https://wiki.manjaro.org/index.php/Special:MyLanguage/Flatpak "Special:MyLanguage/Flatpak") and using [snaps](https://wiki.manjaro.org/index.php/Special:MyLanguage/Snaps "Special:MyLanguage/Snaps") # Installing Updates Update the package database and update all packages on the system ```zsh sudo pacman -Syu ``` Update all packages on the system and allow packages to be downgraded. Downgrading should be only be needed when switching to an older branch. For example, switching from Testing to Stable. ```zsh sudo pacman -Syuu ``` # Searching for Packages To search the Manjaro repositories for available packages you can use the command `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: ```zsh pacman -Ss smplayer ``` You can search your installed packages in the same manner using `-Qs` instead of `-Ss`. To search your installed packages for smplayer: ```zsh pacman -Qs smplayer ``` Once you have found a package you can use `pacman -Qi` to get more information about an installed packages or `pacman -Si` for packages in the repos. Following the example above you could use ```zsh pacman -Si smplayer ``` Finally, for a list of all installed packages on your system, enter the following command: ```zsh pacman -Ql ``` # Installing Packages > [!Warning] > Never install a package without updating the system first. On a rolling release this can lead to an unbootable system To install a software package, the basic syntax is `pacman -S packagename`. However, installing a package without updating the system will lead to a partial upgrade situation so all the examples here will use `pacman -Syu packagename` which will install the package and ensure the system is up to date. For example, to install smplayer the command is: ```zsh sudo pacman -Syu smplayer ``` You will then be presented a list of software to install. You may notice this list has more packages than you requested. 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. Pacman can also directly install packages from the local system or a location on the internet. The format of that command is `pacman -U packagelocation`. For example, to install a copy of your package cache you could do something like: ```zsh sudo pacman -U /var/cache/pacman/pkg/smplayer-19.5.0-1-x86_64.pkg.tar.xz ``` Alternatively, you could get it directly from one of Manjaro's mirrors: ```zsh sudo pacman -U https://mirror.alpix.eu/manjaro/stable/community/x86_64/smplayer-19.5.0-1-x86_64.pkg.tar.xz ``` > [!Warning] > When using pacman -U it is up to you to ensure that the package you are installing is fully compatible with your system. # 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. To remove a software package, the basic syntax is `sudo pacman -R packagename`. We could remove the smplayer package we installed above with: ```zsh sudo pacman -R smplayer ``` This will remove the package, but will leave all the dependencies behind. If you also want to remove the unneeded dependencies you could use `pacman -Rsu packagename` as seen in this example: ```zsh sudo pacman -Rsu smplayer ``` Sometimes when you try to remove a package you will not be able to because there are other packages which depend on it. You can use `pacman -Rc packagename` to remove a package and everything that depends on it. Be careful to heed the above warning when using this option. ```zsh sudo pacman -Rc smplayer ``` The most nuclear option is `pacman -Rcs packagename`. > [!Warning] > Use this with extreme caution, or don’t use it at all. `-Rcs` will remove every package that depends on `packagename` regardless of whether a package is needed for something else. This could render Manjaro unusable. Pacman usually also creates backup configuration files when deleting packages. To remove those, you can add `n` to any of the examples above. For example: ```zsh sudo pacman -Rn smplayer ``` ```zsh sudo pacman -Rsun smplayer ``` ```zsh sudo pacman -Rcn smplayer ``` # Source [Pacman Overview - Manjaro Wiki](https://wiki.manjaro.org/index.php/Pacman_Overview)