OnixOS:Package Management
pacman Usage Guide
pacman is the package manager for Arch Linux and its derivatives, designed to manage packages efficiently with simple commands.
Installation
Pacman is included by default in Arch Linux. To ensure it is installed and up to date, run:
sudo pacman -Syu
Basic Usage
Package Installation
To install a package, use:
sudo pacman -S <package_name>
For example, to install Firefox:
sudo pacman -S firefox
Package Removal
To remove a package:
sudo pacman -R <package_name>
To remove a package along with its dependencies:
sudo pacman -Rns <package_name>
System Update
To update all installed packages:
sudo pacman -Syu
To force a database refresh and then update:
sudo pacman -Syyu
Package Management
Searching for Packages
To search for a package in the official repositories:
pacman -Ss <keyword>
To check if a package is installed:
pacman -Qs <package_name>
Package Information
To view package details:
pacman -Qi <package_name>
To list all installed packages:
pacman -Qe
Cleaning Up
To remove orphaned dependencies:
sudo pacman -Rns $( pacman -Qdtq)
To clean the package cache:
sudo pacman -Sc
To remove all cached packages:
sudo pacman -Scc
Troubleshooting
Fixing Key Issues
If a signature error occurs:
sudo pacman-key --init sudo pacman-key --populate archlinux
To refresh keys:
sudo pacman-key --refresh-keys
Resolving Conflicts
If a file conflict error occurs, manually remove the conflicting file and retry:
sudo rm /path/to/conflicting/file sudo pacman -Syu