OnixOS:Package Management: Difference between revisions
From OnixOS
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
''' | ''' pacman Usage Guide''' | ||
''' | ''' pacman''' is the package manager for Arch Linux and its derivatives, designed to manage packages efficiently with simple commands. | ||
== Installation == | == Installation == | ||
pacman is included by default in Arch Linux. To ensure it is installed and up to date, run: | |||
sudo pacman -Syu | sudo pacman -Syu | ||
== Basic Usage == | == Basic Usage == | ||
=== Package Installation === | === Package Installation === | ||
To install a package, use: | To install a package, use: | ||
sudo pacman -S <package_name> | sudo pacman -S <package_name> | ||
For example, to install Firefox: | For example, to install Firefox: | ||
sudo pacman -S firefox | |||
sudo pacman -S firefox | |||
=== Package Removal === | === Package Removal === | ||
To remove a package: | To remove a package: | ||
sudo pacman -R <package_name> | sudo pacman -R <package_name> | ||
To remove a package along with its dependencies: | To remove a package along with its dependencies: | ||
sudo pacman -Rns <package_name> | sudo pacman -Rns <package_name> | ||
=== System Update === | === System Update === | ||
To update all installed packages: | To update all installed packages: | ||
sudo pacman -Syu | sudo pacman -Syu | ||
To force a database refresh and then update: | To force a database refresh and then update: | ||
sudo pacman -Syyu | sudo pacman -Syyu | ||
== Package Management == | == Package Management == | ||
=== Searching for Packages === | === Searching for Packages === | ||
To search for a package in the official repositories: | To search for a package in the official repositories: | ||
pacman -Ss <keyword> | pacman -Ss <keyword> | ||
To check if a package is installed: | To check if a package is installed: | ||
pacman -Qs <package_name> | pacman -Qs <package_name> | ||
=== Package Information === | === Package Information === | ||
To view package details: | To view package details: | ||
pacman -Qi <package_name> | pacman -Qi <package_name> | ||
To list all installed packages: | To list all installed packages: | ||
pacman -Qe | pacman -Qe | ||
== Cleaning Up == | == Cleaning Up == | ||
To remove orphaned dependencies: | To remove orphaned dependencies: | ||
sudo pacman -Rns $(pacman -Qdtq) | sudo pacman -Rns $( pacman -Qdtq) | ||
To clean the package cache: | To clean the package cache: | ||
sudo pacman -Sc | sudo pacman -Sc | ||
To remove all cached packages: | To remove all cached packages: | ||
sudo pacman -Scc | sudo pacman -Scc | ||
== Troubleshooting == | == Troubleshooting == | ||
=== Fixing Key Issues === | === Fixing Key Issues === | ||
If a signature error occurs: | If a signature error occurs: | ||
sudo pacman-key --init | sudo pacman-key --init | ||
sudo pacman-key --populate archlinux | sudo pacman-key --populate archlinux | ||
To refresh keys: | To refresh keys: | ||
sudo pacman-key --refresh-keys | sudo pacman-key --refresh-keys | ||
=== Resolving Conflicts === | === Resolving Conflicts === | ||
If a file conflict error occurs, manually remove the conflicting file and retry: | If a file conflict error occurs, manually remove the conflicting file and retry: | ||
sudo rm /path/to/conflicting/file | sudo rm /path/to/conflicting/file | ||
sudo pacman -Syu | sudo pacman -Syu | ||
== See Also == | == See Also == | ||
* [https://wiki.archlinux.org/title/pacman Arch Linux | * [https://wiki.archlinux.org/title/ pacman Arch Linux pacman Wiki] | ||
* [https://man.archlinux.org/man/pacman.8 | * [https://man.archlinux.org/man/ pacman.8 pacman Manual] |
Revision as of 17:06, 11 March 2025
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