This tutorial is about How to Use Pacman Commands on Arch Linux. We will try our best so that you understand this guide. I hope you like this blog, How to Use Pacman Commands on Arch Linux. If your answer is yes, please do share after reading this.
So lets keep reading for intertesting info:
Check How to Use Pacman Commands on Arch Linux
The unique identifier or key for various Linux distributions resides in the package manager which is used to update, install, configure and remove various specific software packages. The package manager in Arch Linux is called Pacman. In this guide, we will try to introduce you to some unique and commonly used Pacman commands that will make your interaction with Arch Linux easier and more memorable. To take full advantage of what the Pacman team has to offer, it is strongly recommended that you become root or have Sudoer user privileges on your Arch Linux system.
How to Use Pacman Commands on Arch Linux
Updating your system
This command synchronizes and downloads the new copy of the package master database from the server that is defined in the pacman.conf file.
- sudo pacman-Syy
- -S: sync packages -y: download new packages databasey: the second y forces download even if it is up to date
upgrade system
This updates any packages that are out of date after the sync and downloads the new package database.
Update a single package
If you want to update a single package, use the package name at the end. For example, if you just want to update Firefox and leave other packages on your system, use the following.
Find Package
The following command searches for a package by name and its description in the Arch repository (core, extra, and community). This finds all substrings of the passed parameter. It is not necessary to use wildcards. One thing though, depending on the search string, the result can be a lot. So you may want to filter the output using grep or something else.
Search package with all dependencies
This command is great for listing all the details about the package, like dependencies, package versions, etc. Basically all the information about the package. Remember, you need the exact package name for this command to work. Wildcard search does not work in this command.
installation package
Before installing any packages, be sure to run pacman -Syu to update your system. If you know the name of the package, you can install it with the following command.
For example:
This command shows how much should be downloaded and what is the estimated disk space that will be used after installation.
Download a package without installing
You don’t always want to install a package. Sometimes you may want to just download the package for offline installation. Example: The downloaded file is saved to /var/cache/pacman/pkg defined in the /etc/pacman.conf file.
Install a locally downloaded package
You can install local packages using the following syntax.
- sudo pacman -U /path/to/package
Install the package directly from the URL
If you want to install any package directly from remote network computers, servers or mirrors, you can do it easily by providing the URL.
- sudo pacman -U http://….
reinstall packages
You can reinstall all installed packages on your system using the following command. Be careful when running the following command as it may be a huge list of packages and the download may take time.
- pacman -Qnq | pac-man -S-
pacman -Qnq | pac-man -S-
Uninstall is simple. Run the following command to uninstall a package.
Uninstall with dependencies that do not require other applications
You can use different switches to uninstall a package using pacman, including all its dependencies.
- sudo pacman-rsun firefox
- n: ignore backups, i.e. delete backups as well
- s – Recursively remove each target that is not required by any other package or manually installed
- u: Remove packages not required by any other package.
Show details about installed packages and dependencies
The following command displays information about a package and its dependencies. The output contains the dependent packages, the list of packages this package depends on, and a list of optional dependencies.
Full list of installed packages
If you want a complete list of packages installed on your system, you can use the following command.
You can redirect the output to a text file for further processing.
- pacman -Q > full_list.txt
You can also list explicitly installed packages that are not required by any other packages, using the following command.
The above commands display the package name and versions delimited by spaces. You can only extract package names using the following:
- pac-man -Qe | awk ‘{print $1}’
cleaning system
You can use the following commands to perform various cleanup processes on your system. The following command cleans up unused sync databases and packages that are no longer installed from the cache. So this removes all cache files that are not installed. Cache files are stored in /var/cache/pacman/pkg/
First, you can manually check how much disk space the pacman cache files are using.
- du -h /var/cache/pacman/pkg
You can then run the following to clean.
If you want to clear the entire cache file, use the switch twice.
the pacman files
The following are some of the important pacman files used by this package. You can analyze them for troubleshooting and configuration work.
The main configuration file that contains the pacman configuration is:
- /etc/pacman.conf
- /var/cache/pacman/pkg/
- /var/lib/pacman/sync
- Location of the log file that contains all the pacman commands you have run to date and the details. You can analyze this file for troubleshooting.
- /var/log/pacman.log
Final words: How to Use Pacman Commands on Arch Linux
I hope you understand this article, How to Use Pacman Commands on Arch Linux. If your answer is no, you can ask anything via the contact forum section related to this article. And if your answer is yes, please share this article with your friends and family to give us your support.