{"id":3808,"date":"2020-08-11T19:07:50","date_gmt":"2020-08-11T19:07:50","guid":{"rendered":"https:\/\/linuxiac.com\/?p=3808"},"modified":"2024-12-23T18:53:06","modified_gmt":"2024-12-23T18:53:06","slug":"how-to-use-pacman-to-manage-software-on-arch-linux","status":"publish","type":"post","link":"https:\/\/linuxiac.com\/how-to-use-pacman-to-manage-software-on-arch-linux\/","title":{"rendered":"Beginner&#8217;s Guide to Using Pacman on Arch Linux"},"content":{"rendered":"\n<div class=\"wp-block-ultimate-post-table-of-content ultp-block-1c6ba9\"><div class=\"ultp-block-wrapper\"><div class=\"ultp-block-toc\"><div class=\"ultp-toc-header\"><div class=\"ultp-toc-heading\">Table of Contents<\/div><div class=\"ultp-collapsible-toggle  ultp-collapsible-right\"><a class=\"ultp-collapsible-text ultp-collapsible-open\" href=\"javascript:;\">[Open]<\/a><a class=\"ultp-collapsible-text ultp-collapsible-hide\" href=\"javascript:;\">[Close]<\/a><\/div><\/div><div class=\"ultp-block-toc-style1 ultp-block-toc-body\" style=\"display:block;\"><ul class=\"ultp-toc-lists\"><li><a href=\"#What_Is_Pacman_Package_Manager?\">What Is Pacman Package Manager?<\/a><\/li><li><a href=\"#What_Will_You_Learn_in_This_Guide?\">What Will You Learn in This Guide?<\/a><\/li><li><a href=\"#Refresh_Package_Lists\">Refresh Package Lists<\/a><\/li><li><a href=\"#Searching_for_Package\">Searching for Package<\/a><\/li><li><a href=\"#Getting_Information_About_Package\">Getting Information About Package<\/a><\/li><li><a href=\"#Installing_a_New_Package_with_Pacman\">Installing a New Package with Pacman<\/a><\/li><li><a href=\"#Installing_a_Local_Package\">Installing a Local Package<\/a><\/li><li><a href=\"#Update\/Upgrade_a_Package\">Update\/Upgrade a Package<\/a><\/li><li><a href=\"#Remove_a_Package_with_Pacman\">Remove a Package with Pacman<\/a><\/li><li><a href=\"#Remove_Orphaned_Unused_Packages\">Remove Orphaned (Unused) Packages<\/a><\/li><li><a href=\"#Searching_for_Already_Installed_Packages\">Searching for Already Installed Packages<\/a><\/li><li><a href=\"#Find_All_Files_Owned_by_a_Package\">Find All Files Owned by a Package<\/a><\/li><li><a href=\"#Find_the_Package_Owner_of_the_File\">Find the Package Owner of the File<\/a><\/li><li><a href=\"#Download_a_Package\">Download a Package<\/a><\/li><li><a href=\"#Clean-Up_Package_Cache\">Clean-Up Package Cache<\/a><\/li><li><a href=\"#Conclusion\">Conclusion<\/a><\/li><\/ul><\/div><\/div><\/div><\/div>\n\n\n\n<p>Want to install packages on Arch Linux but need to know how? Many people run into this issue when they first <a href=\"https:\/\/linuxiac.com\/arch-linux-install\/\">move to Arch<\/a>. But don\u2019t worry; you can easily manage packages on your Arch system using the <code>pacman<\/code> command. But first, let&#8217;s answer an important question.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"What_Is_Pacman_Package_Manager?\">What Is Pacman Package Manager?<\/h2>\n\n\n\n<p>Pacman (stands for&nbsp;<strong>Pac<\/strong>kage&nbsp;<strong>Man<\/strong>ager) is the default package manager for <a href=\"https:\/\/linuxiac.com\/archlinux\/\">Arch Linux<\/a>, a lightweight and flexible distro popular among experienced Linux users. Like Arch, Pacman is known for its simplicity, speed, and reliability, combining a simple binary package format with an easy-to-use&nbsp;build system.<\/p>\n\n\n\n<p>Pacman keeps the system up to date by synchronizing package lists with the official Arch repositories. In addition, this client-server model allows the user to download\/install packages with a simple command, complete with all required dependencies.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"What_Will_You_Learn_in_This_Guide?\">What Will You Learn in This Guide?<\/h2>\n\n\n\n<p>We will cover the basics of Pacman, including how to install, update, and remove packages, as well as some more advanced features and tips for using Pacman to its full potential. So, whether you are new to Arch or an experienced Linux user, this guide will help you get the most out of the Pacman.<\/p>\n\n\n\n<p>In addition, this guide also applies to all <a href=\"https:\/\/linuxiac.com\/best-arch-based-linux-distributions\/\">Arch-based Linux distros<\/a>, such as Manjaro, EndeavourOS, Garuda Linux, etc., using Pacman as the package manager.<\/p>\n\n\n\n<p>Of course, the official packages are just one of the sources of software on Arch. In addition, you can install some of the thousands available in the AUR repository \u2013 Arch\u2019s most significant asset that differentiates it from all other Linux distributions.<\/p>\n\n\n\n<p>However, to do this, different Pacman tools are used, known as AUR helpers. In that case, our comprehensive guide on the subject, \u201c<a href=\"https:\/\/linuxiac.com\/how-to-install-aur-packages-in-arch-linux\/\">How to Install AUR Packages in Arch Linux<\/a>,\u201d will greatly help you.<\/p>\n\n\n\n<p>Finally, you can even use one of the excellent <a href=\"https:\/\/linuxiac.com\/best-pacman-gui-frontends-for-arch-linux\/\">GUI Pacman frontends<\/a> to make installing packages in Arch as easy as possible.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Refresh_Package_Lists\">Refresh Package Lists<\/h2>\n\n\n\n<p>Because Arch is a <a href=\"https:\/\/linuxiac.com\/what-is-rolling-release-linux-and-what-is-the-real-benefit-of-using-it\/\">rolling-release distro<\/a>, new packages are added to the distro&#8217;s repositories as soon as they are released. As a result, you should keep the Pacman database up to date by updating it fairly frequently.<\/p>\n\n\n\n<p>So, to update the package lists before installing any packages or updating the system, perform the following:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Sy<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-sync-packages.png\"><img decoding=\"async\" width=\"980\" height=\"252\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-sync-packages.png\" alt=\"Update the Pacman database cache.\" class=\"wp-image-44814\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-sync-packages.png 980w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-sync-packages-380x98.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-sync-packages-768x197.png 768w\" sizes=\"(max-width: 980px) 100vw, 980px\" \/><\/a><figcaption class=\"wp-element-caption\">Update the Pacman database cache.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Searching_for_Package\">Searching for Package<\/h2>\n\n\n\n<p>To search for a specific package, for example, <code>vlc<\/code>, from a sync database (remote server), run:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Ss vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-search-for-package.png\"><img decoding=\"async\" width=\"977\" height=\"340\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-search-for-package.png\" alt=\"Search for a package with Pacman in Arch Linux.\" class=\"wp-image-44817\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-search-for-package.png 977w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-search-for-package-380x132.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-search-for-package-768x267.png 768w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><figcaption class=\"wp-element-caption\">Search for a package with Pacman in Arch Linux.<\/figcaption><\/figure>\n\n\n\n<p>This returns all packages with a matching &#8220;<em>vlc<\/em>&#8221; string in the package name or description.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Getting_Information_About_Package\">Getting Information About Package<\/h2>\n\n\n\n<p>To display the detailed information of the given package from the sync database, for example, <code>nginx<\/code>, run:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">pacman -Si nginx<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-get-package-info.png\"><img decoding=\"async\" width=\"976\" height=\"537\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-get-package-info.png\" alt=\"Get info about specific packages.\" class=\"wp-image-44820\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-get-package-info.png 976w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-get-package-info-380x209.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-get-package-info-768x423.png 768w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><\/a><figcaption class=\"wp-element-caption\">Get info about specific packages.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Installing_a_New_Package_with_Pacman\">Installing a New Package with Pacman<\/h2>\n\n\n\n<p>Installing a package with Pacman is easy. Just run the following command:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -S vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-install-package.png\"><img decoding=\"async\" width=\"977\" height=\"469\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-install-package.png\" alt=\"Installing a Package with Pacman on Arch Linux.\" class=\"wp-image-44823\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-install-package.png 977w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-install-package-380x182.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-install-package-768x369.png 768w\" sizes=\"(max-width: 977px) 100vw, 977px\" \/><\/a><figcaption class=\"wp-element-caption\">Installing a Package with Pacman on Arch Linux.<\/figcaption><\/figure>\n\n\n\n<p>As a result, this process will automatically identify all the necessary dependencies and take care of them. In addition, to install multiple packages with a single command, use a space-separated list of packages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Installing_a_Local_Package\">Installing a Local Package<\/h2>\n\n\n\n<p>Pacman stores all downloaded packages in the&nbsp;<code>\/var\/cache\/pacman\/pkg<\/code>&nbsp;directory.<\/p>\n\n\n\n<p>In case you want to install the locally downloaded package, for example,&nbsp;<code>vlc<\/code>,&nbsp;located in \/var\/cache\/pacman\/pkg\/ directory, go to the folder where the package is located and enter the following command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code lang=\"bash\" class=\"hljs language-javascript language-bash\">cd \/<span class=\"hljs-keyword\">var<\/span>\/cache\/pacman\/pkg\/\nsudo pacman -U vlc<span class=\"hljs-number\">-3.0<\/span><span class=\"hljs-number\">.11<\/span><span class=\"hljs-number\">-2<\/span>-x86_64.pkg.tar.zst<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"Update\/Upgrade_a_Package\">Update\/Upgrade a Package<\/h2>\n\n\n\n<p>To update a single package, for example, <code>rsync<\/code>, run the following:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -S rsync<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"976\" height=\"558\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-reinstall-package.png\" alt=\"Update\/Upgrade a package on Arch Linux with Pacman.\" class=\"wp-image-44826\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-reinstall-package.png 976w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-reinstall-package-380x217.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-reinstall-package-768x439.png 768w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><figcaption class=\"wp-element-caption\">Update\/Upgrade a package on Arch Linux with Pacman.<\/figcaption><\/figure>\n\n\n\n<p>To update all packages at once on your system, just run the following:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Syu<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-system-update.png\"><img decoding=\"async\" width=\"986\" height=\"537\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-system-update.png\" alt=\"Full Arch's system update\/upgrade with Pacman.\" class=\"wp-image-45000\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-system-update.png 986w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-system-update-380x207.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-system-update-768x418.png 768w\" sizes=\"(max-width: 986px) 100vw, 986px\" \/><\/a><figcaption class=\"wp-element-caption\">Full Arch&#8217;s system update\/upgrade with Pacman.<\/figcaption><\/figure>\n\n\n\n<p>However, sometimes you want to upgrade the packages, but you want it to stay at an older version (because you know the newer version has removed a feature or is broken).<\/p>\n\n\n\n<p>So, if&nbsp;the <code>vlc<\/code> package&nbsp;was causing the problem, you could use the following command for this:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Syu --ignore=vlc<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"Remove_a_Package_with_Pacman\">Remove a Package with Pacman<\/h2>\n\n\n\n<p>To remove a package alongside with all its dependencies, run the following command:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Rs vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package.png\"><img decoding=\"async\" width=\"976\" height=\"404\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package.png\" alt=\"Removing a package in Arch Linux.\" class=\"wp-image-44829\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package.png 976w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package-380x157.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package-768x318.png 768w\" sizes=\"(max-width: 976px) 100vw, 976px\" \/><\/a><figcaption class=\"wp-element-caption\">Removing a package in Arch Linux.<\/figcaption><\/figure>\n\n\n\n<p>This command will altogether remove&nbsp;the <code>vlc<\/code>&nbsp;package and all dependencies. While removing packages, Pacman will keep the critical configuration files with the extension&nbsp;<code>.pacsave<\/code>.<\/p>\n\n\n\n<p>In addition, if you no longer want them and want to free up the hard drive, you can remove the package along with all its configuration files with the command:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Rns vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package2.png\"><img decoding=\"async\" width=\"975\" height=\"580\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package2.png\" alt=\"Removing a package in Arch Linux.\" class=\"wp-image-44832\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package2.png 975w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package2-380x226.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-package2-768x457.png 768w\" sizes=\"(max-width: 975px) 100vw, 975px\" \/><\/a><figcaption class=\"wp-element-caption\">Removing a package in Arch Linux.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Remove_Orphaned_Unused_Packages\">Remove Orphaned (Unused) Packages<\/h2>\n\n\n\n<p>After removing a package in Arch Linux, there may still be some remaining orphaned (unused) packages that were dependencies of the removed package. However, these orphaned packages are not required anymore, so we can get rid of them to free up some space.<\/p>\n\n\n\n<p>To remove these packages, run:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code lang=\"bash\" class=\"hljs language-javascript language-bash\">sudo pacman -Rns $(pacman -Qdtq)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages.png\"><img decoding=\"async\" width=\"998\" height=\"778\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages.png\" alt=\"Removing orphaned packages in Arch Linux.\" class=\"wp-image-44835\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages.png 998w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages-380x296.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages-768x599.png 768w\" sizes=\"(max-width: 998px) 100vw, 998px\" \/><\/a><figcaption class=\"wp-element-caption\">Removing orphaned packages in Arch Linux.<\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>If no orphans were found, the output is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"950\" height=\"140\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages2.png\" alt=\"Remove Orphaned (Unused) Packages on Arch Linux\" class=\"wp-image-44838\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages2.png 950w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages2-380x56.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-remove-orphaned-packages2-768x113.png 768w\" sizes=\"(max-width: 950px) 100vw, 950px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Searching_for_Already_Installed_Packages\">Searching for Already Installed Packages<\/h2>\n\n\n\n<p>Sometimes you want to check for a specific package if it is installed locally. In this case, you can do it using the command below:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">pacman -Qs vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-searching-for-installed-package.png\"><img decoding=\"async\" width=\"941\" height=\"162\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-searching-for-installed-package.png\" alt=\"Search among installed packages with Pacman in Arch.\" class=\"wp-image-44841\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-searching-for-installed-package.png 941w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-searching-for-installed-package-380x65.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-searching-for-installed-package-768x132.png 768w\" sizes=\"(max-width: 941px) 100vw, 941px\" \/><\/a><figcaption class=\"wp-element-caption\">Search among installed packages with Pacman in Arch.<\/figcaption><\/figure>\n\n\n\n<p>You can view a list of all the packages installed on your system using the following command:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">pacman -Q<\/code><\/span><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id=\"Find_All_Files_Owned_by_a_Package\">Find All Files Owned by a Package<\/h2>\n\n\n\n<p>You can find all the files that are installed by a specific package using the following command:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">pacman -Ql vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-files.png\"><img decoding=\"async\" width=\"920\" height=\"557\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-files.png\" alt=\"Find all files owned by a package.\" class=\"wp-image-44844\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-files.png 920w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-files-380x230.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-files-768x465.png 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/a><figcaption class=\"wp-element-caption\">Find all files owned by a package.<\/figcaption><\/figure>\n\n\n\n<p>This returns the package name and the path to files that it owns.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Find_the_Package_Owner_of_the_File\">Find the Package Owner of the File<\/h2>\n\n\n\n<p>If you want to check the location of the binary executable file owned by a package, use the <code>-Qo<\/code> flag.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">pacman -Qo \/usr\/bin\/vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-package-owner.png\"><img decoding=\"async\" width=\"921\" height=\"142\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-package-owner.png\" alt=\"Find the package owner of the file.\" class=\"wp-image-44847\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-package-owner.png 921w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-package-owner-380x59.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-find-package-owner-768x118.png 768w\" sizes=\"(max-width: 921px) 100vw, 921px\" \/><\/a><figcaption class=\"wp-element-caption\">Find the package owner of the file.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Download_a_Package\">Download a Package<\/h2>\n\n\n\n<p>Sometimes, you can download a package and keep it in your cache without installing it. For example, you can use the downloaded package later. To do so, run:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">pacman -Sw vlc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-download-package.png\"><img decoding=\"async\" width=\"920\" height=\"313\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-download-package.png\" alt=\"Download a package with Pacman.\" class=\"wp-image-44850\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-download-package.png 920w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-download-package-380x129.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-download-package-768x261.png 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/a><figcaption class=\"wp-element-caption\">Download a package with Pacman.<\/figcaption><\/figure>\n\n\n\n<p>The above command will only download the <code>vlc<\/code> package and keep it in the cache folder. Pacman stores all downloaded packages in the&nbsp;<code>\/var\/cache\/pacman\/pkg<\/code>&nbsp;directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Clean-Up_Package_Cache\">Clean-Up Package Cache<\/h2>\n\n\n\n<p>All packages we downloaded during the installation will be stored in the cache directory, i.e.,&nbsp;<code>\/var\/cache\/pacman\/pkg\/<\/code>. But if you don&#8217;t remove them periodically, they will slowly eat up your hard drive space; sooner or later, you could end up with low <a href=\"https:\/\/linuxiac.com\/check-disk-space-linux\/\">disk space<\/a>.<\/p>\n\n\n\n<p>So it is good to remove the cache periodically. For example, to remove all the cached packages and the unused sync database, execute the following:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Sc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database.png\"><img decoding=\"async\" width=\"920\" height=\"338\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database.png\" alt=\"Clean up package cache in Arch Linux.\" class=\"wp-image-44853\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database.png 920w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database-380x140.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database-768x282.png 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/a><figcaption class=\"wp-element-caption\">Clean up package cache in Arch Linux.<\/figcaption><\/figure>\n\n\n\n<p>In addition, if you want to remove all files from the cache, use the clean <code>c<\/code> switch twice. Of course, this is the most aggressive approach and will leave nothing in the cache folder:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code lang=\"bash\" class=\"hljs language-bash\">sudo pacman -Scc<\/code><\/span><\/pre>\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database2.png\"><img decoding=\"async\" width=\"918\" height=\"293\" src=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database2.png\" alt=\"Pacman - Clean-Up Package Cache\" class=\"wp-image-44856\" srcset=\"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database2.png 918w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database2-380x121.png 380w, https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/pacman-clean-up-database2-768x245.png 768w\" sizes=\"(max-width: 918px) 100vw, 918px\" \/><\/a><figcaption class=\"wp-element-caption\">Clean up package cache in Arch Linux.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Conclusion\">Conclusion<\/h2>\n\n\n\n<p>Arch Linux is one of the most reputed and famous Linux distributions. This guide has covered most of the commands you need to know when using Pacman to install, update, and remove software on Arch.<\/p>\n\n\n\n<p>We also strongly suggest checking out our guide, &#8220;<a href=\"https:\/\/linuxiac.com\/how-to-find-fastest-arch-linux-mirror\/\">Finding the Most Up-to-Date and Fastest Arch Linux Mirrors<\/a>.&#8221; It will enhance your experience with Pacman and increase your knowledge.<\/p>\n\n\n\n<p>I hope that it was helpful in your journey with Arch. For more information, refer to the <a href=\"https:\/\/wiki.archlinux.org\/title\/Pacman\" target=\"_blank\" rel=\"noreferrer noopener\">Arch Linux Wiki<\/a>, which provides official documentation about the Pacman package manager.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide shows how to use Arch&#8217;s Pacman package manager to manage software by installing, removing, and updating packages.<\/p>\n","protected":false},"author":10,"featured_media":123014,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4417],"tags":[4264,2016,2015],"class_list":["post-3808","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tips","category-linux-knowledge","tag-arch-linux","tag-package-manager","tag-pacman"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6},"post_title_panel":"","has_hero_section":"default","6ce2d77e597ed303fdda4b7558abf019":"","hero_section":"type-2","hero_elements":[{"id":"custom_title","enabled":true,"heading_tag":"h1","title":"Home","__id":"5aPmdM9x_vQnXmdNakT1F"},{"id":"custom_description","enabled":false,"description_visibility":{"desktop":true,"tablet":true,"mobile":false},"__id":"0lWrluyFupGLCBqeEKnr8"},{"id":"custom_meta","enabled":true,"meta_elements":[{"id":"author","enabled":true,"label":"By","has_author_avatar":"no","avatar_size":50,"__id":"mBx2YtKH2cfITndhs3izB"},{"id":"post_date","enabled":false,"label":"On","date_format_source":"default","date_format":"M j, Y","__id":"LsIx_lX_3N3pvGpiSyc17"},{"id":"updated_date","enabled":true,"label":"Updated","date_format_source":"default","date_format":"M j, Y","__id":"wgr7kTgPA4vB_Q-j4L1on"},{"id":"categories","enabled":false,"label":"In","style":"simple","__id":"B77vYxwOKRPXqwtGgT6Cc"},{"id":"comments","enabled":true,"__id":"F9VIYKi_xvX5RzOVJbMAn"}],"page_meta_elements":{"joined":true,"articles_count":true,"comments":true},"__id":"fw96LInXwRuWr1TB_sSun","meta_type":"label","meta_divider":"slash"},{"id":"breadcrumbs","enabled":false,"__id":"65F77m79WXMkeF41sR0gh"}],"da2c28d0e41208e21840168f657b4790":"","hero_alignment1":"CT_CSS_SKIP_RULE","hero_margin":40,"hero_alignment2":"center","hero_vertical_alignment":"center","da7d2387dab6e4fba428b6bf07afe88d":"","hero_structure":"normal","fd6769e916308e20fca81434bef9105d":"","page_title_bg_type":"custom_image","custom_hero_background":{"attachment_id":44808,"url":"https:\/\/linuxiac.com\/wp-content\/uploads\/2020\/08\/archlinux-pacman-header-1024x237.jpg"},"page_title_image_size":"full","parallax":{"desktop":false,"tablet":false,"mobile":false},"c975c6408ebb503fbad25e41a05cc336":"","hero_height":"250px","pageTitleFont":{"family":"Default","variation":"Default","size":{"desktop":"2.8em","tablet":"2.8em","mobile":"2.8em","__changed":[]},"line-height":"CT_CSS_SKIP_RULE","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"CT_CSS_SKIP_RULE","text-decoration":"CT_CSS_SKIP_RULE"},"pageTitleFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageMetaFont":{"family":"Default","variation":"n6","size":"12px","line-height":"1.3","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"uppercase","text-decoration":"CT_CSS_SKIP_RULE"},"pageMetaFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"page_meta_button_type_font_colors":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"page_meta_button_type_background_colors":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageExcerptFont":{"family":"Default","variation":"Default","size":"CT_CSS_SKIP_RULE","line-height":"CT_CSS_SKIP_RULE","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"CT_CSS_SKIP_RULE","text-decoration":"CT_CSS_SKIP_RULE"},"pageExcerptColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"breadcrumbsFont":{"family":"Default","variation":"Default","size":"CT_CSS_SKIP_RULE","line-height":"CT_CSS_SKIP_RULE","letter-spacing":"CT_CSS_SKIP_RULE","text-transform":"CT_CSS_SKIP_RULE","text-decoration":"CT_CSS_SKIP_RULE"},"breadcrumbsFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"initial":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageTitleOverlay":{"background_type":"color","background_pattern":"type-1","background_image":{"attachment_id":null,"x":0,"y":0},"gradient":"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)","background_repeat":"repeat","background_size":"auto","background_attachment":"scroll","patternColor":{"default":{"color":"#e5e7ea"}},"overlayColor":{"default":{"color":"CT_CSS_SKIP_RULE"}},"backgroundColor":{"default":{"color":"CT_CSS_SKIP_RULE"}}},"pageTitleBackground":{"background_type":"color","background_pattern":"type-1","background_image":{"attachment_id":null,"x":0,"y":0},"gradient":"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)","background_repeat":"repeat","background_size":"auto","background_attachment":"scroll","patternColor":{"default":{"color":"#e5e7ea"}},"overlayColor":{"default":{"color":"CT_CSS_SKIP_RULE"}},"backgroundColor":{"default":{"color":"var(--theme-palette-color-6)"}}},"pageTitlePadding":{"top":"50px","bottom":"50px","left":"auto","right":"auto","linked":true},"f58aa2cd5430b539cd46dc097aff3590":"","page_structure_type":"default","534bb70e296bd4040f08b0535d26f1e3":"","content_style_source":"inherit","content_style":"wide","5b69004e212d03ecc512df6da89c01b2":"","vertical_spacing_source":"inherit","content_area_spacing":"both","background":{"background_type":"color","background_pattern":"type-1","background_image":{"attachment_id":null,"x":0,"y":0},"gradient":"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)","background_repeat":"repeat","background_size":"auto","background_attachment":"scroll","patternColor":{"default":{"color":"#e5e7ea"}},"overlayColor":{"default":{"color":"CT_CSS_SKIP_RULE"}},"backgroundColor":{"default":{"color":"CT_CSS_SKIP_RULE"}}},"content_background":{"background_type":"color","background_pattern":"type-1","background_image":{"attachment_id":null,"x":0,"y":0},"gradient":"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)","background_repeat":"repeat","background_size":"auto","background_attachment":"scroll","patternColor":{"default":{"color":"#e5e7ea"}},"overlayColor":{"default":{"color":"CT_CSS_SKIP_RULE"}},"backgroundColor":{"default":{"color":"var(--theme-palette-color-8)"}}},"content_boxed_shadow":{"inherit":false,"blur":18,"spread":-6,"v_offset":12,"h_offset":0,"inset":false,"enable":true,"color":{"color":"rgba(34, 56, 101, 0.04)"}},"boxed_content_spacing":{"desktop":{"top":"40px","bottom":"40px","left":"40px","right":"40px","linked":true},"tablet":{"top":"35px","bottom":"35px","left":"35px","right":"35px","linked":true},"mobile":{"top":"20px","bottom":"20px","left":"20px","right":"20px","linked":true}},"content_boxed_radius":{"top":"3px","bottom":"3px","left":"3px","right":"3px","linked":true},"ece0412701433e41fae9c78395a1eb6b":"","disable_featured_image":"no","disable_post_tags":"no","disable_share_box":"no","disable_author_box":"no","disable_posts_navigation":"no","disable_subscribe_form":"no","e57b1f297f7f6771b21f5906e892a641":"","disable_related_posts":"no","disable_header":"no","disable_footer":"no","47d4bf2a2669f0efef8b93048c38750f":"","header_footer_scripts_panel":"","header_scripts":"","4f14065542eb258843ceecd600a0ef06":"","header_after_body_scripts":"","e8e464f6f52988b771356584889306da":"","footer_scripts":"","8905c5ae44eec3de4ac277dc8c347a30":"","56a7ce46f01ba8481546cc1efbc69546":"","bc3bfdc5b692913f948df05e3f4733e6":"","a025c95e66313ebf25a241ae60679e2e":"","6539aea0a69740e802be102120f2e641":"","0fa370e4f694eb68e70cd623c1d52af9":"","e6238b48575cf2cd16f88a78744fa11e":"","c921150ab3e9227b1b311e67715bac11":"","content_boxed_border":{"width":1,"style":"none","color":{"color":"rgba(44,62,80,0.2)"}},"95b59908ab135f4decc14a35f0b06f48":"","e1e7f32997f80980f78e90379fc5c634":"","be8e95f1b50879ddc1e22a89814f57fd":"","9aaf0d00f06693c6e4734f9fa5a16748":"","ba388149420d9004e46b64648d11af60":""},"_links":{"self":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/3808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/comments?post=3808"}],"version-history":[{"count":0,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/posts\/3808\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media\/123014"}],"wp:attachment":[{"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/media?parent=3808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/categories?post=3808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxiac.com\/wp-json\/wp\/v2\/tags?post=3808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}