OnixOS:Package Management: Difference between revisions

From OnixOS
No edit summary
No edit summary
 
Line 4: Line 4:


== Installation ==
== Installation ==
pacman is included by default in Arch Linux. To ensure it is installed and up to date, run:
Pacman is included by default in Arch Linux. To ensure it is installed and up to date, run:


   sudo  pacman -Syu
   sudo  pacman -Syu

Latest revision as of 17:08, 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

See Also