Pacman Package ManagerIn preceding articles, we’ve got proven you a way to deploy applications on Debian based Linux distributions the use of apt-get and we’ve also proven you a way to deploy applications on Red Hat based Linux distributions using yum.
In this guide, we will show you a way to install applications the usage of the command line within Arch-primarily based Linux distributions consisting of Manjaro.
Which Applications Are Installed on Your Computer You can view a listing of all of the applications installed on your machine the usage of the following command:
pacman -Q
This will return a list of all the applications on your computer and their version numbers.
Pacman Package Manager Viewing the ChangeLog for an Installed Application
pacman -Q -c octopi
Pacman Package Manager View Packages Installed As Dependencies for Other Packages
The above command will show you the changelog for octopi if it exists. If it would not exist a message can be displayed telling you that no changelog is available.
pacman -Q -d
The above command shows you all the files that are installed as dependencies to other packages.
pacman -Q -d -t
This will display you all of the orphaned dependencies established to your computer.
Pacman Package Manager View Explicitly Installed Packages
If you need to look all the explicitly hooked up programs use the subsequent command:
pacman -Q -e
An explicit package is one that you actually chose to install as opposed to a package that was installed as a dependency to other packages.
You can see which explicit packages have no dependencies by using the following command:
pacman -Q -e -t
Pacman Package Manager View All the Packages in a Group
To see which groups packages belong to you can use the following command:
pacman -Q -g
To see which groups packages belong to you can use the following command:
pacman -Q -g
This will list the name of the group followed by the name of the package.
If you want to see all the packages in a particular group you can specify the group name:
pacman -Q -g base
Return Information About Installed Packages
If you want to know the name, description and all other manner of details about a package use the following command:
pacman -Q -i packagename
The output includes:
- name
- version
- description
- architecture
- URL to package’s website
- License
- Groups
- Provides
- Depends On
- Optional Deps
- Required By
- Optional For
- Conflicts With
- Replaces
- Installed Size
- Name Of Packager
- Build Date
- Install Date
- Install Reason
- Install Script
- Validated
Check the Health of an Installed Package
To check the health of a particular package you can use the following command:
pacman -Q -k packagename
This will return output similar to the following:
scratch: 1208 total files, 0 missing files
You can run this command against all the installed packages:
pacman -Q -k
Find All Files Owned by a Package
You can find all the files that are owned by a specific package using the following command:
pacman -Q -l packagename
This returns the package name and the path to files that it owns. You can specify multiple packages after the -l.
Find Packages Not Found in the Sync Databases (i.e. Installed Manually)
You can find manually installed packages using the following command:
pacman -Q -m
Packages installed using yaourt such as Google Chrome will be listed using this command.
Pacman Package Manager Find Packages Only Available in the Sync Databases
This is the inverse to the previous command and only shows packages installed via the sync databases.
pacman -Q -n
Find Out of Date Packages
To find packages that need to be updated use the following command:
pacman -Q -u
This will return a list of packages, their version numbers, and the latest version numbers.
How to Install a Package Using Pacman
To install a package use the following command:
pacman -S packagename
You may need to use the sudo command to elevate your permissions for this command to run. Alternatively, switch to a user with elevated permissions using the su command.
When a package is available in multiple repositories you can choose which repository to use by specifying it in the command as follows:
pacman -S repositoryname/packagename
Installing a package with pacman will automatically download and install any dependencies.
You can also install a group of packages such as a desktop environment like XFCE.
When you specify a group name the output will be along the lines of:
There are 17 members in group xfce4
Repository extra 1) exo 2) garcon 3) gtk-xfce-engine
You can choose to install all the packages in the group by pressing return. Alternatively, you can install individual packages by providing a comma-separated list of numbers (i.e. 1,2,3,4,5). If you want to install all the packages between 1 and 10 you can also use a hyphen (i.e. 1-10).
How to Upgrade Out of Date Packages
To upgrade all of the out-of-date packages use the following command:
pacman -S -u
Sometimes you want to upgrade the packages but for one particular package, you want it to stay at an older version (because you know the newer version has removed a feature or is broken). You can use the following command for this:
pacman -S -u --ignore packagename
Show a List of Available Packages
You can view a list of the available packages in the sync database with the following command:
pacman -S -l
Display Information About a Package in the Sync Database
You can find detailed information about a package in the sync database using the following command:
pacman -S -i packagename
Search for a Package in the Sync Database
If you just want to search for a package in the sync database use the following command:
pacman -S -s packagename
The results will be a list of all available packages matching the search criteria.
Refresh the Sync Database
You can make sure the sync database is up to date using the following command:
pacman -S -y
This should be used prior to running the upgrade command. It is also useful to run this if you haven’t done it in a while so that when you search you are getting the latest results.
A Note About Switches
Throughout this guide, you will have noticed that we have specified each switch on its own. For example:
pacman -S -u
You can, of course, combine switches:
pacman -Su